<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- saved from url=(0055)http://blog.csdn.net/farmer_cc/article/details/18619429 -->
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><script src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/getRecommendList.html"></script>   
    
     
    <script async="" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/analytics.js"></script><script type="text/javascript" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/tracking.js" charset="utf-8"></script>  

    <script type="text/javascript">
        var protocol = window.location.protocol;
        document.write('<script type="text/javascript" src="' + protocol + '//csdnimg.cn/pubfooter/js/repoAddr2.js?v=' + Math.random() + '"></' + 'script>');
    </script><script type="text/javascript" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/repoAddr2.js"></script>

     <script id="allmobilize" charset="utf-8" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/allmobilize.min.js"></script><style type="text/css"></style>
 <meta http-equiv="Cache-Control" content="no-siteapp"><link rel="alternate" media="handheld" href="http://blog.csdn.net/farmer_cc/article/details/18619429#">

    <title>深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏
        - 博客频道 - CSDN.NET</title>
    
    <meta name="description" content="第一题(60分)：       按要求分解字符串，输入两个数M，N；M代表输入的M串字符串，N代表输出的每串字符串的位数，不够补0。例如：输入2,8， “abc” ，“123456789”，则输出为“abc00000”,“12345678“,”90000000”#include#includeusing namespace std;void solve(char *str , in">
    <script src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/jquery.js" type="text/javascript"></script>
    <script type="text/javascript" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/ad.js"></script>
        <!--new top-->
       
        <link rel="stylesheet" href="http://static.csdn.net/public/common/toolbar/css/index.css">
        <!--new top-->

    <link rel="Stylesheet" type="text/css" href="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/style.css">
    <link id="RSSLink" title="RSS" type="application/rss+xml" rel="alternate" href="http://blog.csdn.net/farmer_cc/rss/list">
    <link rel="shortcut icon" href="http://c.csdnimg.cn/public/favicon.ico">
    <link type="text/css" rel="stylesheet" href="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/default.css">
 


<script src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/share.js"></script><style type="text/css">.MathJax_Hover_Frame {border-radius: .25em; -webkit-border-radius: .25em; -moz-border-radius: .25em; -khtml-border-radius: .25em; box-shadow: 0px 0px 15px #83A; -webkit-box-shadow: 0px 0px 15px #83A; -moz-box-shadow: 0px 0px 15px #83A; -khtml-box-shadow: 0px 0px 15px #83A; border: 1px solid #A6D ! important; display: inline-block; position: absolute}
.MathJax_Hover_Arrow {position: absolute; width: 15px; height: 11px; cursor: pointer}
</style><style type="text/css">#MathJax_About {position: fixed; left: 50%; width: auto; text-align: center; border: 3px outset; padding: 1em 2em; background-color: #DDDDDD; color: black; cursor: default; font-family: message-box; font-size: 120%; font-style: normal; text-indent: 0; text-transform: none; line-height: normal; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; z-index: 201; border-radius: 15px; -webkit-border-radius: 15px; -moz-border-radius: 15px; -khtml-border-radius: 15px; box-shadow: 0px 10px 20px #808080; -webkit-box-shadow: 0px 10px 20px #808080; -moz-box-shadow: 0px 10px 20px #808080; -khtml-box-shadow: 0px 10px 20px #808080; filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')}
.MathJax_Menu {position: absolute; background-color: white; color: black; width: auto; padding: 5px 0px; border: 1px solid #CCCCCC; margin: 0; cursor: default; font: menu; text-align: left; text-indent: 0; text-transform: none; line-height: normal; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; z-index: 201; border-radius: 5px; -webkit-border-radius: 5px; -moz-border-radius: 5px; -khtml-border-radius: 5px; box-shadow: 0px 10px 20px #808080; -webkit-box-shadow: 0px 10px 20px #808080; -moz-box-shadow: 0px 10px 20px #808080; -khtml-box-shadow: 0px 10px 20px #808080; filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')}
.MathJax_MenuItem {padding: 1px 2em; background: transparent}
.MathJax_MenuArrow {position: absolute; right: .5em; color: #666666}
.MathJax_MenuActive .MathJax_MenuArrow {color: white}
.MathJax_MenuArrow.RTL {left: .5em; right: auto}
.MathJax_MenuCheck {position: absolute; left: .7em}
.MathJax_MenuCheck.RTL {right: .7em; left: auto}
.MathJax_MenuRadioCheck {position: absolute; left: .7em}
.MathJax_MenuRadioCheck.RTL {right: .7em; left: auto}
.MathJax_MenuLabel {padding: 1px 2em 3px 1.33em; font-style: italic}
.MathJax_MenuRule {border-top: 1px solid #DDDDDD; margin: 4px 3px}
.MathJax_MenuDisabled {color: GrayText}
.MathJax_MenuActive {background-color: #606872; color: white}
.MathJax_Menu_Close {position: absolute; width: 31px; height: 31px; top: -15px; left: -15px}
</style><style type="text/css">#MathJax_Zoom {position: absolute; background-color: #F0F0F0; overflow: auto; display: block; z-index: 301; padding: .5em; border: 1px solid black; margin: 0; font-weight: normal; font-style: normal; text-align: left; text-indent: 0; text-transform: none; line-height: normal; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; box-shadow: 5px 5px 15px #AAAAAA; -webkit-box-shadow: 5px 5px 15px #AAAAAA; -moz-box-shadow: 5px 5px 15px #AAAAAA; -khtml-box-shadow: 5px 5px 15px #AAAAAA; filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')}
#MathJax_ZoomOverlay {position: absolute; left: 0; top: 0; z-index: 300; display: inline-block; width: 100%; height: 100%; border: 0; padding: 0; margin: 0; background-color: white; opacity: 0; filter: alpha(opacity=0)}
#MathJax_ZoomFrame {position: relative; display: inline-block; height: 0; width: 0}
#MathJax_ZoomEventTrap {position: absolute; left: 0; top: 0; z-index: 302; display: inline-block; border: 0; padding: 0; margin: 0; background-color: white; opacity: 0; filter: alpha(opacity=0)}
</style><style type="text/css">.MathJax_Preview {color: #888}
#MathJax_Message {position: fixed; left: 1em; bottom: 1.5em; background-color: #E6E6E6; border: 1px solid #959595; margin: 0px; padding: 2px 8px; z-index: 102; color: black; font-size: 80%; width: auto; white-space: nowrap}
#MathJax_MSIE_Frame {position: absolute; top: 0; left: 0; width: 0px; z-index: 101; border: 0px; margin: 0px; padding: 0px}
.MathJax_Error {color: #CC0000; font-style: italic}
</style><link rel="stylesheet" type="text/css" href="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/job_reco.css"><link rel="stylesheet" type="text/css" href="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/job_reco.css"><link href="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/bdsstyle.css" rel="stylesheet" type="text/css"><script type="text/javascript" charset="utf-8" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/main.js"></script><script charset="utf-8" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/lightapp.js" data-appid="3629560" async="" name="baidu-tc-cerfication"></script><link rel="stylesheet" type="text/css" href="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/style(1).css"><link type="text/css" rel="stylesheet" href="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/style(2).css"><script src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/logger.js"></script><script src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/get" async="" type="text/javascript" charset="utf-8"></script><script type="text/javascript" charset="utf-8" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/helper-utils-moplus-monitor_7cf38e1.js" _md_="_anymoore_http://apps.bdimg.com/cloudaapi/pkg/helper-utils-moplus-monitor_7cf38e1.js"></script><link rel="stylesheet" href="http://bdimg.share.baidu.com/static/api/css/share_style0_16.css?v=8105b07e.css"><script type="text/javascript" charset="utf-8" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/push-smartBar_98ddc18.js" _md_="_anymoore_http://apps.bdimg.com/cloudaapi/pkg/push-smartBar_98ddc18.js"></script><script type="text/javascript" charset="utf-8" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/app-socialshare_ef6acd0.js" _md_="_anymoore_http://apps.bdimg.com/cloudaapi/pkg/app-socialshare_ef6acd0.js"></script><script type="text/javascript" charset="utf-8" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/consult_df5a12e.js" _md_="_anymoore_http://apps.bdimg.com/cloudaapi/s/consult_df5a12e.js"></script><script type="text/javascript" charset="utf-8" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/account-pay_aef1a13.js" _md_="_anymoore_http://apps.bdimg.com/cloudaapi/pkg/account-pay_aef1a13.js"></script><script src="http://127.0.0.1:7777/weakBindLight?apikey=zGhG9os6hVZxp2KLek3cwIuM&nonce=Txkc694UtElxZNxW9Ex6&csrftoken=e172d34387efeb67be6ffb40840bf1c9&channel=clouda&callback=cloudaPushServiceWeakBindLight"></script></head>
<body class=" hPC" style=""><iframe frameborder="0" style="display: none;"></iframe><div id="MathJax_Message" style="display: none;"></div>
    
   
      <!--new top-->
    <script id="toolbar-tpl-scriptId" fixed="true" prod="blog" skin="black" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/html.js" type="text/javascript"></script><div class="csdn-toolbar csdn-toolbar-skin-black ">        <div class="container row center-block ">          <div class="col-md-3 pull-left logo clearfix"><a href="http://www.csdn.net/?ref=toolbar" title="CSDN首页" target="_blank" class="icon"></a><a title="频道首页" href="http://blog.csdn.net/?ref=toolbar_logo" class="img blog-icon"></a></div>          <div class="pull-right login-wrap unlogin">            <ul class="btns">              <li class="loginlink"><a href="https://passport.csdn.net/account/login?ref=toolbar" target="_top">登录&nbsp;</a>|<a target="_top" href="http://passport.csdn.net/account/mobileregister?ref=toolbar&action=mobileRegister">&nbsp;注册</a></li>              <li class="search">                <div class="icon on-search-icon">                  <div class="wrap">                    <div class="curr-icon-wrap">                      <div class="curr-icon"></div>                    </div>                    <form action="http://so.csdn.net/search" method="get" target="_blank">                      <input type="hidden" value="toolbar" name="ref" accesskey="2">                      <div class="border">                        <input placeholder="搜索" type="text" value="" name="q" accesskey="2"><span class="icon-enter-sm"></span>                      </div>                    </form>                  </div>                </div>              </li>              <li class="favor">                <div class="icon on-favor-icon">                  <div class="wrap">                    <div class="curr-icon-wrap">                      <div class="curr-icon"></div>                    </div>                    <div style="display:none;" class="favor-success"><span class="msg">收藏成功</span>                      <div class="btns"><span class="btn btn-primary ok">确定</span></div>                    </div>                    <div style="display:none;" class="favor-failed"><span class="icon-danger-lg"></span><span class="msg">收藏失败，请重新收藏</span>                      <div class="btns"><span class="btn btn-primary ok">确定</span></div>                    </div>                    <form role="form" class="form-horizontal favor-form">                      <div class="form-group">                        <div class="clearfix">                          <label for="input-title" class="col-sm-2 control-label">标题</label>                          <div class="col-sm-10">                            <input id="inputTitle" type="text" placeholder="" class="title form-control">                          </div>                        </div>                        <div class="alert alert-danger"><strong></strong>标题不能为空</div>                      </div>                      <div class="form-group">                        <label for="input-url" class="col-sm-2 control-label">网址</label>                        <div class="col-sm-10">                          <input id="input-url" type="text" placeholder="" class="url form-control">                        </div>                      </div>                      <div class="form-group">                        <label for="input-tag" class="col-sm-2 tag control-label">标签</label>                        <div class="col-sm-10">                          <input id="input-tag" type="text" class="form-control tag">                        </div>                      </div>                      <div class="form-group">                        <label for="input-description" class="description col-sm-2 control-label">摘要</label>                        <div class="col-sm-10">                          <textarea id="input-description" class="form-control description"></textarea>                        </div>                      </div>                      <div class="form-group">                        <div class="col-sm-offset-2 col-sm-10 ft">                          <div class="col-sm-4 pull-left">                            <div class="checkbox">                              <label>                                <input type="checkbox" name="share" checked="checked" class="share">公开                              </label>                            </div>                          </div>                          <div class="col-sm-8 pull-right favor-btns">                            <button type="button" class="cancel btn btn-default">取消</button>                            <button type="submit" class="submit btn btn-primary">收藏</button>                          </div>                        </div>                      </div>                    </form>                  </div>                </div>              </li>              <li class="notify">                <div style="display:none" class="number"></div>                <div style="display:none" class="icon-hasnotes-sm"></div>                <div id="header_notice_num"></div>                <div class="icon on-notify-icon">                  <div class="wrap">                    <div class="curr-icon-wrap">                      <div class="curr-icon"></div>                    </div>                    <div id="note1" class="csdn_note">                      <div class="box"></div>                    <iframe src="about:block" frameborder="0" allowtransparency="true" style="z-index:-1;position:absolute;top:0;left:0;width:100%;height:100%;background:transparent"></iframe></div>                  </div>                </div>              </li>              <li class="ugc">                <div class="icon on-ugc-icon">                  <div class="wrap clearfix">                    <div class="curr-icon-wrap">                      <div class="curr-icon"></div>                    </div>                    <dl>                      <dt><a href="http://geek.csdn.net/news/expert?ref=toolbar" target="_blank" class="p-news clearfix" style="display:none;"><em class="icon"></em><span>分享资讯</span></a></dt>                      <dt><a href="http://u.download.csdn.net/upload?ref=toolbar" target="_blank" class="p-doc clearfix"><em class="icon"></em><span>传PPT/文档</span></a></dt>                      <dt><a href="http://bbs.csdn.net/topics/new?ref=toolbar" target="_blank" class="p-ask clearfix"><em class="icon"></em><span>提问题</span></a></dt>                      <dt><a href="http://write.blog.csdn.net/postedit?ref=toolbar" target="_blank" class="p-blog clearfix"><em class="icon"></em><span>写博客</span></a></dt>                      <dt><a href="http://u.download.csdn.net/upload?ref=toolbar" target="_blank" class="p-src clearfix"><em class="icon"></em><span>传资源</span></a></dt>                      <dt><a href="https://code.csdn.net/projects/new?ref=toolbar" target="_blank" class="c-obj clearfix"><em class="icon"></em><span>创建项目</span></a></dt>                      <dt><a href="https://code.csdn.net/snippets/new?ref=toolbar" target="_blank" class="c-code clearfix"><em class="icon"></em><span>创建代码片</span></a></dt>                    </dl>                  </div>                </div>              </li>              <li class="profile">                <div class="icon on-profile-icon"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/100x100.jpg" class="curr-icon-img">                  <div class="wrap clearfix">                    <div class="curr-icon-wrap">                      <div class="curr-icon"></div>                    </div>                    <div class="bd">                      <dl class="clearfix">                        <dt class="pull-left img"><a target="_blank" href="http://my.csdn.net/?ref=toolbar" class="avatar"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/100x100.jpg"></a></dt>                        <dd class="info" style="border: none;"><a target="_blank" href="http://my.csdn.net/?ref=toolbar" class="nickname"></a><a class="set-nick" href="https://passport.csdn.net/account/profile">设置昵称<span class="write-icon"></span></a><span class="dec"><a class="fill-dec" href="http://my.csdn.net/" target="_blank">编辑自我介绍，让更多人了解你<span class="write-icon"></span></a></span></dd>                      </dl>                    </div>                    <div class="ft clearfix"><a target="_blank" href="http://my.csdn.net/my/account/changepwd?ref=toolbar" class="pull-left"><span class="icon-cog"></span>帐号设置</a><a href="https://passport.csdn.net/account/logout?ref=toolbar" target="_top" class="pull-left" style="margin-left:132px; width:18px; height:27px; white-space:nowrap; overflow:hidden;"><span class="icon-signout"></span><span class="out">退出</span></a></div>                  </div>                </div>              </li>              <li class="apps">                <div id="chasnew123" class="hasnew" style="display: none;"></div>                <div id="cappsarea123" class="icon on-apps-icon">                  <div class="wrap clearfix">                    <div class="curr-icon-wrap">                      <div class="curr-icon"></div>                    </div>                  <div class="detail">                    <dl>                      <dt>                        <h5>社区</h5>                      </dt>                      <dd> <a href="http://blog.csdn.net/?ref=toolbar" target="_blank">博客</a></dd>                      <dd> <a href="http://bbs.csdn.net/?ref=toolbar" target="_blank">论坛</a></dd>                      <dd> <a href="http://download.csdn.net/?ref=toolbar" target="_blank">下载</a></dd>                      <dd><a href="http://ask.csdn.net/?ref=toolbar" target="_blank">技术问答</a></dd>                      <dd><a href="http://geek.csdn.net/?ref=toolbar" target="_blank">极客头条</a></dd>                      <dd> <a href="http://hero.csdn.net/?ref=toolbar" target="_blank">英雄会</a></dd>                    </dl>                  </div>                  <div class="detail">                    <dl>                      <dt>                        <h5>服务</h5>                      </dt>                      <dd> <a href="http://job.csdn.net/?ref=toolbar" target="_blank">JOB<img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/new.gif" style="display: none; margin-top: -26px; width: 23px;"></a></dd>                      <dd> <a href="http://edu.csdn.net/?ref=toolbar" target="_blank">学院<img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/new.gif" style="display: none; margin-top: -26px; width: 23px;"></a></dd>                      <dd> <a href="https://code.csdn.net/?ref=toolbar" target="_blank">CODE</a></dd>                      <dd> <a href="http://huiyi.csdn.net/?ref=toolbar" target="_blank">活动</a></dd>                      <dd> <a href="http://www.csto.com/?ref=toolbar" target="_blank">CSTO</a></dd>                      <dd> <a href="http://mall.csdn.net/?ref=toolbar" target="_blank">C币兑换<img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/new.gif" style="display: none; margin-top: -26px; width: 23px;"></a></dd>                    </dl>                  </div>                  <div class="detail last">                    <dl>                      <dt>                        <h5>俱乐部</h5>                      </dt>                      <dd> <a href="http://cto.csdn.net/?ref=toolbar" target="_blank">CTO俱乐部</a></dd>                      <dd> <a href="http://student.csdn.net/?ref=toolbar" target="_blank">高校俱乐部</a></dd>                    </dl>                  </div>                </div>              </div>            </li>            </ul>          </div>        </div>    </div>
     <!--new top-->
    <div id="container">
        <div id="header">
    <div class="header">
        <div id="blog_title">
            <h2>
                <a href="http://blog.csdn.net/farmer_cc">farmer_cc的专栏</a></h2>
            <h3></h3>
            <div class="clear">
            </div>
        </div>
        <div class="clear">
        </div>
    </div>
</div>
<div id="navigator">
    <div class="navigator_bg">
    </div>
    <div class="navigator">
        <ul>
            
                <li id="btnContents"><a href="http://blog.csdn.net/farmer_cc?viewmode=contents"><span onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_mulu&#39;])">
                    <img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/ico_list.gif">目录视图</span></a></li>
                <li id="btnView"><a href="http://blog.csdn.net/farmer_cc?viewmode=list"><span onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_zhaiyao&#39;])">
                    <img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/ico_summary.gif">摘要视图</span></a></li>
                <li id="btnRss"><a href="http://blog.csdn.net/farmer_cc/rss/list"><span onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_RSS&#39;])">
                    <img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/ico_rss.gif">订阅</span></a></li>                

            </ul>
    </div>
</div>
<script type="text/javascript">
    var username = "farmer_cc";
    var _blogger = username;
    var blog_address = "http://blog.csdn.net/farmer_cc";
    var static_host = "http://static.blog.csdn.net";
    var currentUserName = "";  
</script>

        <div id="body">
            <div id="main">
                <div class="main">
                        <div class="ad_class">
<div class="notice tracking-ad" data-mod="popu_3"> 

<a href="http://special.csdncms.csdn.net/rust/index.shtml" target="_blank"><font color="red">
Rust开发技术学习路线</font></a>
&nbsp;&nbsp;&nbsp;
  

<a href="http://huiyi.csdn.net/activity/product/goods_list?project_id=2215" target="_blank">
<font color="blue">Android开发，8月14开课啦！
</font></a>
&nbsp;&nbsp;&nbsp;

<a href="http://bss.csdn.net/m/product/blog_essay" target="_blank">
<font color="red">聊聊高效编程，送800元大奖
</font></a>
&nbsp;&nbsp;&nbsp;
<a href="http://www.csdn.net/app/" target="_blank">
<font color="blue">CSDN移动客户端，下载送50C币
</font></a>
&nbsp;&nbsp;&nbsp;</div>                        </div>
                        

  
<link href="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/comment1.css" type="text/css" rel="stylesheet">
<link href="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/style1.css" type="text/css" rel="stylesheet">
<script language="JavaScript" type="text/javascript" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/jquery.cookie.js"></script>
<script type="text/javascript" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/main(1).js"></script>
<link rel="stylesheet" href="http://static.blog.csdn.net/public/res-min/markdown_views.css?v=1.0">
<script type="text/javascript" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/MathJax.js"></script>

  <script type="text/ecmascript">
      window.quickReplyflag = true;
    </script>
<div id="article_details" class="details">
    <div class="article_title">   
         <span class="ico ico_type_Original"></span>


    <h1>
        <span class="link_title"><a href="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET.html">
        <font color="red">[置顶]</font>
        深入分析UI 上层事件处理核心机制 Choreographer            
        </a></span>
    </h1>
</div>

   

    <div class="article_manage">
        <span class="link_categories">
        分类：
            <a href="http://blog.csdn.net/farmer_cc/article/category/683683" onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_fenlei&#39;]);">Android相关</a> 
            <a href="http://blog.csdn.net/farmer_cc/article/category/1866853" onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_fenlei&#39;]);">动画</a> 
        </span>
    <span class="link_postdate">2014-01-22 00:13</span>
    <span class="link_view" title="阅读次数">9297人阅读</span>
    <span class="link_comments" title="评论次数"><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#comments" onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_pinglun&#39;])">评论</a>(9)</span>
    <span class="link_collect"><a href="javascript:void(0);" onclick="javascript:collectArticle(&#39;深入分析UI 上层事件处理核心机制 Choreographer&#39;,&#39;18619429&#39;);return false;" title="收藏">收藏</a></span>
    <span class="link_report"><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#report" onclick="javascript:report(18619429,2);return false;" title="举报">举报</a></span>
    
</div>

  

  
  
     

<div style="clear:both"></div><div style="border:solid 1px #ccc; background:#eee; float:left; min-width:200px;padding:4px 10px;"><p style="text-align:right;margin:0;"><span style="float:left;">目录<a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" title="系统根据文章中H1到H6标签自动生成文章目录">(?)</a></span><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" onclick="javascript:return openct(this);" title="展开">[+]</a></p><ol style="display:none;margin-left:14px;padding-left:14px;line-height:160%;"><li><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#t0">深入分析UI 上层事件处理核心机制 Choreographer </a></li><li><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#t1">Choreographer 是什么有什么</a></li><li><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#t2">从VSYNC 开始case MSG_DO_SCHEDULE_VSYNC</a></li><li><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#t3">哪里会使用Choreographer</a></li></ol></div><div style="clear:both"></div><div id="article_content" class="article_content">

<h1><a name="t0"></a>深入分析UI 上层事件处理核心机制 Choreographer </h1>
<p>结论写在前面：Choreographer就是一个消息处理器，根据vsync 信号 来计算frame，而计算frame的方式就是处理三种回调，包括事件回调、动画回调、绘制回调。这三种事件在消息输入、加入动画、准备绘图layout 等动作时均会发给Choreographer。</p>
<p>下面来看分析过程<br>
</p>
<p>看过一些源码后，发现ui 绘制的管理，调度都是通过Choreographer这个类。</p>
<h1><a name="t1"></a>1 Choreographer 是什么？有什么？</h1>
<p>Choreographer 是个普通类，final 表示不能被继承修改其行为。<br>
</p>
<div class="dp-highlighter bg_java"><div class="bar"><div class="tools"><b>[java]</b> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="ViewSource" title="view plain" onclick="dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;">view plain</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="CopyToClipboard" title="copy" onclick="dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;">copy</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="PrintSource" title="print" onclick="dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;">print</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="About" title="?" onclick="dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;">?</a><a href="https://code.csdn.net/snippets/166166" target="_blank" title="在CODE上查看代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/CODE_ico.png" width="12" height="12" alt="在CODE上查看代码片" style="position:relative;top:1px;left:2px;"></a><a href="https://code.csdn.net/snippets/166166/fork" target="_blank" title="派生到我的代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/ico_fork.svg" width="12" height="12" alt="派生到我的代码片" style="position:relative;top:2px;left:2px;"></a><div style="position: absolute; left: 487px; top: 705px; width: 18px; height: 18px; z-index: 99;"><embed id="ZeroClipboardMovie_1" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="18" height="18" name="ZeroClipboardMovie_1" align="middle" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=1&amp;width=18&amp;height=18" wmode="transparent"></div></div></div><ol start="1" class="dp-j"><li class="alt"><span><span class="keyword">public</span><span>&nbsp;</span><span class="keyword">final</span><span>&nbsp;</span><span class="keyword">class</span><span>&nbsp;Choreographer&nbsp;&nbsp;</span></span></li></ol></div><pre code_snippet_id="166166" snippet_file_name="blog_20140122_1_8424122" name="code" class="java" style="display: none;">public final class Choreographer</pre>单例模式持有一个本地进程的单例对象，
<p></p>
<p></p>
<div class="dp-highlighter bg_java"><div class="bar"><div class="tools"><b>[java]</b> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="ViewSource" title="view plain" onclick="dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;">view plain</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="CopyToClipboard" title="copy" onclick="dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;">copy</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="PrintSource" title="print" onclick="dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;">print</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="About" title="?" onclick="dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;">?</a><a href="https://code.csdn.net/snippets/166166" target="_blank" title="在CODE上查看代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/CODE_ico.png" width="12" height="12" alt="在CODE上查看代码片" style="position:relative;top:1px;left:2px;"></a><a href="https://code.csdn.net/snippets/166166/fork" target="_blank" title="派生到我的代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/ico_fork.svg" width="12" height="12" alt="派生到我的代码片" style="position:relative;top:2px;left:2px;"></a><div style="position: absolute; left: 487px; top: 821px; width: 18px; height: 18px; z-index: 99;"><embed id="ZeroClipboardMovie_2" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="18" height="18" name="ZeroClipboardMovie_2" align="middle" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=2&amp;width=18&amp;height=18" wmode="transparent"></div></div></div><ol start="1" class="dp-j"><li class="alt"><span><span class="keyword">private</span><span>&nbsp;</span><span class="keyword">static</span><span>&nbsp;</span><span class="keyword">final</span><span>&nbsp;ThreadLocal&lt;Choreographer&gt;&nbsp;sThreadInstance&nbsp;=&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">new</span><span>&nbsp;ThreadLocal&lt;Choreographer&gt;()&nbsp;&nbsp;</span></span></li></ol></div><pre code_snippet_id="166166" snippet_file_name="blog_20140122_2_3680613" name="code" class="java" style="display: none;">    private static final ThreadLocal&lt;Choreographer&gt; sThreadInstance =
            new ThreadLocal&lt;Choreographer&gt;()</pre>该对象必须持有looper，意味着将使用消息队列
<p></p>
<p></p>
<div class="dp-highlighter bg_java"><div class="bar"><div class="tools"><b>[java]</b> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="ViewSource" title="view plain" onclick="dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;">view plain</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="CopyToClipboard" title="copy" onclick="dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;">copy</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="PrintSource" title="print" onclick="dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;">print</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="About" title="?" onclick="dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;">?</a><a href="https://code.csdn.net/snippets/166166" target="_blank" title="在CODE上查看代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/CODE_ico.png" width="12" height="12" alt="在CODE上查看代码片" style="position:relative;top:1px;left:2px;"></a><a href="https://code.csdn.net/snippets/166166/fork" target="_blank" title="派生到我的代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/ico_fork.svg" width="12" height="12" alt="派生到我的代码片" style="position:relative;top:2px;left:2px;"></a><div style="position: absolute; left: 487px; top: 956px; width: 18px; height: 18px; z-index: 99;"><embed id="ZeroClipboardMovie_3" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="18" height="18" name="ZeroClipboardMovie_3" align="middle" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=3&amp;width=18&amp;height=18" wmode="transparent"></div></div></div><ol start="1" class="dp-j"><li class="alt"><span><span class="keyword">protected</span><span>&nbsp;Choreographer&nbsp;initialValue()&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;Looper&nbsp;looper&nbsp;=&nbsp;Looper.myLooper();&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">if</span><span>&nbsp;(looper&nbsp;==&nbsp;</span><span class="keyword">null</span><span>)&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">throw</span><span>&nbsp;</span><span class="keyword">new</span><span>&nbsp;IllegalStateException(</span><span class="string">"The&nbsp;current&nbsp;thread&nbsp;must&nbsp;have&nbsp;a&nbsp;looper!"</span><span>);&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">return</span><span>&nbsp;</span><span class="keyword">new</span><span>&nbsp;Choreographer(looper);&nbsp;&nbsp;</span></span></li><li class="alt"><span>}&nbsp;&nbsp;</span></li></ol></div><pre code_snippet_id="166166" snippet_file_name="blog_20140122_3_7999011" name="code" class="java" style="display: none;">        protected Choreographer initialValue() {
            Looper looper = Looper.myLooper();
            if (looper == null) {
                throw new IllegalStateException("The current thread must have a looper!");
            }
            return new Choreographer(looper);
        }</pre>持有一个handler 对象
<p></p>
<p></p>
<div class="dp-highlighter bg_java"><div class="bar"><div class="tools"><b>[java]</b> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="ViewSource" title="view plain" onclick="dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;">view plain</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="CopyToClipboard" title="copy" onclick="dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;">copy</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="PrintSource" title="print" onclick="dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;">print</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="About" title="?" onclick="dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;">?</a><a href="https://code.csdn.net/snippets/166166" target="_blank" title="在CODE上查看代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/CODE_ico.png" width="12" height="12" alt="在CODE上查看代码片" style="position:relative;top:1px;left:2px;"></a><a href="https://code.csdn.net/snippets/166166/fork" target="_blank" title="派生到我的代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/ico_fork.svg" width="12" height="12" alt="派生到我的代码片" style="position:relative;top:2px;left:2px;"></a><div style="position: absolute; left: 487px; top: 1182px; width: 18px; height: 18px; z-index: 99;"><embed id="ZeroClipboardMovie_4" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="18" height="18" name="ZeroClipboardMovie_4" align="middle" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=4&amp;width=18&amp;height=18" wmode="transparent"></div></div></div><ol start="1" class="dp-j"><li class="alt"><span><span class="keyword">private</span><span>&nbsp;</span><span class="keyword">final</span><span>&nbsp;FrameHandler&nbsp;mHandler;&nbsp;&nbsp;</span></span></li></ol></div><pre code_snippet_id="166166" snippet_file_name="blog_20140122_4_6602788" name="code" class="java" style="display: none;">    private final FrameHandler mHandler;</pre>这个handler对象仅处理3种事件：
<p></p>
<p></p>
<div class="dp-highlighter bg_java"><div class="bar"><div class="tools"><b>[java]</b> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="ViewSource" title="view plain" onclick="dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;">view plain</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="CopyToClipboard" title="copy" onclick="dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;">copy</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="PrintSource" title="print" onclick="dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;">print</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="About" title="?" onclick="dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;">?</a><a href="https://code.csdn.net/snippets/166166" target="_blank" title="在CODE上查看代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/CODE_ico.png" width="12" height="12" alt="在CODE上查看代码片" style="position:relative;top:1px;left:2px;"></a><a href="https://code.csdn.net/snippets/166166/fork" target="_blank" title="派生到我的代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/ico_fork.svg" width="12" height="12" alt="派生到我的代码片" style="position:relative;top:2px;left:2px;"></a><div style="position: absolute; left: 487px; top: 1299px; width: 18px; height: 18px; z-index: 99;"><embed id="ZeroClipboardMovie_5" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="18" height="18" name="ZeroClipboardMovie_5" align="middle" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=5&amp;width=18&amp;height=18" wmode="transparent"></div></div></div><ol start="1" class="dp-j"><li class="alt"><span><span class="keyword">private</span><span>&nbsp;</span><span class="keyword">final</span><span>&nbsp;</span><span class="keyword">class</span><span>&nbsp;FrameHandler&nbsp;</span><span class="keyword">extends</span><span>&nbsp;Handler&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;FrameHandler(Looper&nbsp;looper)&nbsp;{&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">super</span><span>(looper);&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;<span class="annotation">@Override</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">void</span><span>&nbsp;handleMessage(Message&nbsp;msg)&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">switch</span><span>&nbsp;(msg.what)&nbsp;{&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">case</span><span>&nbsp;MSG_DO_FRAME:&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;doFrame(System.nanoTime(),&nbsp;<span class="number">0</span><span>);&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">break</span><span>;&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">case</span><span>&nbsp;MSG_DO_SCHEDULE_VSYNC:&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;doScheduleVsync();&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">break</span><span>;&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">case</span><span>&nbsp;MSG_DO_SCHEDULE_CALLBACK:&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;doScheduleCallback(msg.arg1);&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">break</span><span>;&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class=""><span>}&nbsp;&nbsp;</span></li></ol></div><pre code_snippet_id="166166" snippet_file_name="blog_20140122_5_9284984" name="code" class="java" style="display: none;">    private final class FrameHandler extends Handler {
        public FrameHandler(Looper looper) {
            super(looper);
        }

        @Override
        public void handleMessage(Message msg) {
            switch (msg.what) {
                case MSG_DO_FRAME:
                    doFrame(System.nanoTime(), 0);
                    break;
                case MSG_DO_SCHEDULE_VSYNC:
                    doScheduleVsync();
                    break;
                case MSG_DO_SCHEDULE_CALLBACK:
                    doScheduleCallback(msg.arg1);
                    break;
            }
        }
    }</pre>在scheduleFrameLocked中事件被静态变量USE_VSYNC分开，也就是系统仅使用MSG_DO_SCHEDULE_VSYNC或MSG_DO_FRAME。
<p></p>
<p>查一下概念，的确符合，DO_FRAME 是帧刷新，SCHEDULE_VSYNC是 垂直同步刷新。</p>
<p>在android4.1上加入的VSYNC 特性，并使用三重缓冲大幅改善了android 图像方面的性能。</p>
<p>这里有篇文章讲的很清楚：<a target="_blank" href="http://www.androidpolice.com/2012/07/12/getting-to-know-android-4-1-part-3-project-butter-how-it-works-and-what-it-added/">http://www.androidpolice.com/2012/07/12/getting-to-know-android-4-1-part-3-project-butter-how-it-works-and-what-it-added/</a></p>
<p><br>
</p>
<p></p>
<div class="dp-highlighter bg_java"><div class="bar"><div class="tools"><b>[java]</b> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="ViewSource" title="view plain" onclick="dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;">view plain</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="CopyToClipboard" title="copy" onclick="dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;">copy</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="PrintSource" title="print" onclick="dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;">print</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="About" title="?" onclick="dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;">?</a><a href="https://code.csdn.net/snippets/166166" target="_blank" title="在CODE上查看代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/CODE_ico.png" width="12" height="12" alt="在CODE上查看代码片" style="position:relative;top:1px;left:2px;"></a><a href="https://code.csdn.net/snippets/166166/fork" target="_blank" title="派生到我的代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/ico_fork.svg" width="12" height="12" alt="派生到我的代码片" style="position:relative;top:2px;left:2px;"></a><div style="position: absolute; left: 487px; top: 1975px; width: 18px; height: 18px; z-index: 99;"><embed id="ZeroClipboardMovie_6" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="18" height="18" name="ZeroClipboardMovie_6" align="middle" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=6&amp;width=18&amp;height=18" wmode="transparent"></div></div></div><ol start="1" class="dp-j"><li class="alt"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">private</span><span>&nbsp;</span><span class="keyword">void</span><span>&nbsp;scheduleFrameLocked(</span><span class="keyword">long</span><span>&nbsp;now)&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">if</span><span>&nbsp;(USE_VSYNC)&nbsp;{&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">if</span><span>&nbsp;(isRunningOnLooperThreadLocked())&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scheduleVsyncLocked();&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<span class="keyword">else</span><span>&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Message&nbsp;msg&nbsp;=&nbsp;mHandler.obtainMessage(MSG_DO_SCHEDULE_VSYNC);&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;msg.setAsynchronous(<span class="keyword">true</span><span>);&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mHandler.sendMessageAtFrontOfQueue(msg);&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<span class="keyword">else</span><span>&nbsp;{&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Message&nbsp;msg&nbsp;=&nbsp;mHandler.obtainMessage(MSG_DO_FRAME);&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;msg.setAsynchronous(<span class="keyword">true</span><span>);&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mHandler.sendMessageAtTime(msg,&nbsp;nextFrameTime);&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li></ol></div><pre code_snippet_id="166166" snippet_file_name="blog_20140122_6_3636403" name="code" class="java" style="display: none;">    private void scheduleFrameLocked(long now) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (USE_VSYNC) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (isRunningOnLooperThreadLocked()) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; scheduleVsyncLocked();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Message msg = mHandler.obtainMessage(MSG_DO_SCHEDULE_VSYNC);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; msg.setAsynchronous(true);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mHandler.sendMessageAtFrontOfQueue(msg);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Message msg = mHandler.obtainMessage(MSG_DO_FRAME);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; msg.setAsynchronous(true);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mHandler.sendMessageAtTime(msg, nextFrameTime);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
</pre>
<p></p>
<h1><a name="t2"></a>2 从VSYNC 开始case MSG_DO_SCHEDULE_VSYNC:</h1>
<p></p>
<div class="dp-highlighter bg_java"><div class="bar"><div class="tools"><b>[java]</b> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="ViewSource" title="view plain" onclick="dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;">view plain</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="CopyToClipboard" title="copy" onclick="dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;">copy</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="PrintSource" title="print" onclick="dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;">print</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="About" title="?" onclick="dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;">?</a><a href="https://code.csdn.net/snippets/166166" target="_blank" title="在CODE上查看代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/CODE_ico.png" width="12" height="12" alt="在CODE上查看代码片" style="position:relative;top:1px;left:2px;"></a><a href="https://code.csdn.net/snippets/166166/fork" target="_blank" title="派生到我的代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/ico_fork.svg" width="12" height="12" alt="派生到我的代码片" style="position:relative;top:2px;left:2px;"></a><div style="position: absolute; left: 487px; top: 2330px; width: 18px; height: 18px; z-index: 99;"><embed id="ZeroClipboardMovie_7" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="18" height="18" name="ZeroClipboardMovie_7" align="middle" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=7&amp;width=18&amp;height=18" wmode="transparent"></div></div></div><ol start="1" class="dp-j"><li class="alt"><span><span class="keyword">void</span><span>&nbsp;doScheduleVsync()&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">synchronized</span><span>&nbsp;(mLock)&nbsp;{&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">if</span><span>&nbsp;(mFrameScheduled)&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scheduleVsyncLocked();&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>}&nbsp;&nbsp;</span></li></ol></div><pre code_snippet_id="166166" snippet_file_name="blog_20140122_7_1335108" name="code" class="java" style="display: none;">    void doScheduleVsync() {
        synchronized (mLock) {
            if (mFrameScheduled) {
                scheduleVsyncLocked();
            }
        }
    }</pre><div class="dp-highlighter bg_html"><div class="bar"><div class="tools"><b>[html]</b> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="ViewSource" title="view plain" onclick="dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;">view plain</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="CopyToClipboard" title="copy" onclick="dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;">copy</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="PrintSource" title="print" onclick="dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;">print</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="About" title="?" onclick="dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;">?</a><a href="https://code.csdn.net/snippets/166166" target="_blank" title="在CODE上查看代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/CODE_ico.png" width="12" height="12" alt="在CODE上查看代码片" style="position:relative;top:1px;left:2px;"></a><a href="https://code.csdn.net/snippets/166166/fork" target="_blank" title="派生到我的代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/ico_fork.svg" width="12" height="12" alt="派生到我的代码片" style="position:relative;top:2px;left:2px;"></a><div style="position: absolute; left: 489px; top: 2511px; width: 18px; height: 18px; z-index: 99;"><embed id="ZeroClipboardMovie_8" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="18" height="18" name="ZeroClipboardMovie_8" align="middle" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=8&amp;width=18&amp;height=18" wmode="transparent"></div></div></div><ol start="1" class="dp-xml"><li class="alt"><span><span>private&nbsp;void&nbsp;scheduleVsyncLocked()&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;mDisplayEventReceiver.scheduleVsync();&nbsp;&nbsp;</span></li><li class="alt"><span>}&nbsp;&nbsp;</span></li></ol></div><pre code_snippet_id="166166" snippet_file_name="blog_20140122_8_8161761" name="code" class="html" style="display: none;">    private void scheduleVsyncLocked() {
        mDisplayEventReceiver.scheduleVsync();
    }</pre><div class="dp-highlighter bg_java"><div class="bar"><div class="tools"><b>[java]</b> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="ViewSource" title="view plain" onclick="dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;">view plain</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="CopyToClipboard" title="copy" onclick="dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;">copy</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="PrintSource" title="print" onclick="dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;">print</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="About" title="?" onclick="dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;">?</a><a href="https://code.csdn.net/snippets/166166" target="_blank" title="在CODE上查看代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/CODE_ico.png" width="12" height="12" alt="在CODE上查看代码片" style="position:relative;top:1px;left:2px;"></a><a href="https://code.csdn.net/snippets/166166/fork" target="_blank" title="派生到我的代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/ico_fork.svg" width="12" height="12" alt="派生到我的代码片" style="position:relative;top:2px;left:2px;"></a><div style="position: absolute; left: 487px; top: 2619px; width: 18px; height: 18px; z-index: 99;"><embed id="ZeroClipboardMovie_9" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="18" height="18" name="ZeroClipboardMovie_9" align="middle" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=9&amp;width=18&amp;height=18" wmode="transparent"></div></div></div><ol start="1" class="dp-j"><li class="alt"><span><span class="keyword">public</span><span>&nbsp;</span><span class="keyword">void</span><span>&nbsp;scheduleVsync()&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">if</span><span>&nbsp;(mReceiverPtr&nbsp;==&nbsp;</span><span class="number">0</span><span>)&nbsp;{&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.w(TAG,&nbsp;<span class="string">"Attempted&nbsp;to&nbsp;schedule&nbsp;a&nbsp;vertical&nbsp;sync&nbsp;pulse&nbsp;but&nbsp;the&nbsp;display&nbsp;event&nbsp;"</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&nbsp;<span class="string">"receiver&nbsp;has&nbsp;already&nbsp;been&nbsp;disposed."</span><span>);&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<span class="keyword">else</span><span>&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nativeScheduleVsync(mReceiverPtr);&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class=""><span>}&nbsp;&nbsp;</span></li></ol></div><pre code_snippet_id="166166" snippet_file_name="blog_20140122_9_1749029" name="code" class="java" style="display: none;">    public void scheduleVsync() {
        if (mReceiverPtr == 0) {
            Log.w(TAG, "Attempted to schedule a vertical sync pulse but the display event "
                    + "receiver has already been disposed.");
        } else {
            nativeScheduleVsync(mReceiverPtr);
        }
    }</pre>一路调用到nativeScheduleVsync();
<p></p>
<p>native的东西先不往下看，回头来看mDisplayEventReceiver <br>
</p>
<p></p>
<div class="dp-highlighter bg_java"><div class="bar"><div class="tools"><b>[java]</b> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="ViewSource" title="view plain" onclick="dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;">view plain</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="CopyToClipboard" title="copy" onclick="dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;">copy</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="PrintSource" title="print" onclick="dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;">print</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="About" title="?" onclick="dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;">?</a><a href="https://code.csdn.net/snippets/166166" target="_blank" title="在CODE上查看代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/CODE_ico.png" width="12" height="12" alt="在CODE上查看代码片" style="position:relative;top:1px;left:2px;"></a><a href="https://code.csdn.net/snippets/166166/fork" target="_blank" title="派生到我的代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/ico_fork.svg" width="12" height="12" alt="派生到我的代码片" style="position:relative;top:2px;left:2px;"></a><div style="position: absolute; left: 487px; top: 2913px; width: 18px; height: 18px; z-index: 99;"><embed id="ZeroClipboardMovie_10" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="18" height="18" name="ZeroClipboardMovie_10" align="middle" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=10&amp;width=18&amp;height=18" wmode="transparent"></div></div></div><ol start="1" class="dp-j"><li class="alt"><span><span class="keyword">private</span><span>&nbsp;</span><span class="keyword">final</span><span>&nbsp;</span><span class="keyword">class</span><span>&nbsp;FrameDisplayEventReceiver&nbsp;</span><span class="keyword">extends</span><span>&nbsp;DisplayEventReceiver&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">implements</span><span>&nbsp;Runnable&nbsp;&nbsp;&nbsp;</span></span></li></ol></div><pre code_snippet_id="166166" snippet_file_name="blog_20140122_10_4464244" name="code" class="java" style="display: none;">    private final class FrameDisplayEventReceiver extends DisplayEventReceiver
            implements Runnable </pre>观察一下方法名都是onXX ，一看就是回调的节奏
<p></p>
<p></p>
<div class="dp-highlighter bg_java"><div class="bar"><div class="tools"><b>[java]</b> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="ViewSource" title="view plain" onclick="dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;">view plain</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="CopyToClipboard" title="copy" onclick="dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;">copy</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="PrintSource" title="print" onclick="dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;">print</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="About" title="?" onclick="dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;">?</a><a href="https://code.csdn.net/snippets/166166" target="_blank" title="在CODE上查看代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/CODE_ico.png" width="12" height="12" alt="在CODE上查看代码片" style="position:relative;top:1px;left:2px;"></a><a href="https://code.csdn.net/snippets/166166/fork" target="_blank" title="派生到我的代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/ico_fork.svg" width="12" height="12" alt="派生到我的代码片" style="position:relative;top:2px;left:2px;"></a><div style="position: absolute; left: 487px; top: 3048px; width: 18px; height: 18px; z-index: 99;"><embed id="ZeroClipboardMovie_11" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="18" height="18" name="ZeroClipboardMovie_11" align="middle" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=11&amp;width=18&amp;height=18" wmode="transparent"></div></div></div><ol start="1" class="dp-j"><li class="alt"><span><span class="comment">//&nbsp;Called&nbsp;from&nbsp;native&nbsp;code.</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span><span class="annotation">@SuppressWarnings</span><span>(</span><span class="string">"unused"</span><span>)&nbsp;&nbsp;</span></span></li><li class="alt"><span><span class="keyword">private</span><span>&nbsp;</span><span class="keyword">void</span><span>&nbsp;dispatchVsync(</span><span class="keyword">long</span><span>&nbsp;timestampNanos,&nbsp;</span><span class="keyword">int</span><span>&nbsp;builtInDisplayId,&nbsp;</span><span class="keyword">int</span><span>&nbsp;frame)&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;onVsync(timestampNanos,&nbsp;builtInDisplayId,&nbsp;frame);&nbsp;&nbsp;</span></li><li class="alt"><span>}&nbsp;&nbsp;</span></li></ol></div><pre code_snippet_id="166166" snippet_file_name="blog_20140122_11_244123" name="code" class="java" style="display: none;">    // Called from native code.
    @SuppressWarnings("unused")
    private void dispatchVsync(long timestampNanos, int builtInDisplayId, int frame) {
        onVsync(timestampNanos, builtInDisplayId, frame);
    }</pre>看到这里的注释，就明确了这个类就是被native回调了。回调时调用onVsync();而这个方法时在FrameDisplayEventReceiver中重写的。
<p></p>
<p></p>
<div class="dp-highlighter bg_java"><div class="bar"><div class="tools"><b>[java]</b> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="ViewSource" title="view plain" onclick="dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;">view plain</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="CopyToClipboard" title="copy" onclick="dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;">copy</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="PrintSource" title="print" onclick="dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;">print</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="About" title="?" onclick="dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;">?</a><a href="https://code.csdn.net/snippets/166166" target="_blank" title="在CODE上查看代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/CODE_ico.png" width="12" height="12" alt="在CODE上查看代码片" style="position:relative;top:1px;left:2px;"></a><a href="https://code.csdn.net/snippets/166166/fork" target="_blank" title="派生到我的代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/ico_fork.svg" width="12" height="12" alt="派生到我的代码片" style="position:relative;top:2px;left:2px;"></a><div style="position: absolute; left: 487px; top: 3262px; width: 18px; height: 18px; z-index: 99;"><embed id="ZeroClipboardMovie_12" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="18" height="18" name="ZeroClipboardMovie_12" align="middle" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=12&amp;width=18&amp;height=18" wmode="transparent"></div></div></div><ol start="1" class="dp-j"><li class="alt"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="annotation">@Override</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">void</span><span>&nbsp;onVsync(</span><span class="keyword">long</span><span>&nbsp;timestampNanos,&nbsp;</span><span class="keyword">int</span><span>&nbsp;builtInDisplayId,&nbsp;</span><span class="keyword">int</span><span>&nbsp;frame)&nbsp;{&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mTimestampNanos&nbsp;=&nbsp;timestampNanos;&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mFrame&nbsp;=&nbsp;frame;&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Message&nbsp;msg&nbsp;=&nbsp;Message.obtain(mHandler,&nbsp;<span class="keyword">this</span><span>);&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;msg.setAsynchronous(<span class="keyword">true</span><span>);&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mHandler.sendMessageAtTime(msg,&nbsp;timestampNanos&nbsp;/&nbsp;NANOS_PER_MS);&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="annotation">@Override</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">void</span><span>&nbsp;run()&nbsp;{&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mHavePendingVsync&nbsp;=&nbsp;<span class="keyword">false</span><span>;&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;doFrame(mTimestampNanos,&nbsp;mFrame);&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li></ol></div><pre code_snippet_id="166166" snippet_file_name="blog_20140122_12_5990980" name="code" class="java" style="display: none;">        @Override
        public void onVsync(long timestampNanos, int builtInDisplayId, int frame) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mTimestampNanos = timestampNanos;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mFrame = frame;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Message msg = Message.obtain(mHandler, this);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; msg.setAsynchronous(true);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mHandler.sendMessageAtTime(msg, timestampNanos / NANOS_PER_MS);

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @Override
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public void run() {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mHavePendingVsync = false;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; doFrame(mTimestampNanos, mFrame);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
</pre>在onsync中把自己的runnable 加到消息队列中执行，这里使用异步消息，调用绘制do_frame()方法。
<p></p>
<p></p>
<div class="dp-highlighter bg_java"><div class="bar"><div class="tools"><b>[java]</b> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="ViewSource" title="view plain" onclick="dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;">view plain</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="CopyToClipboard" title="copy" onclick="dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;">copy</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="PrintSource" title="print" onclick="dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;">print</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="About" title="?" onclick="dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;">?</a><a href="https://code.csdn.net/snippets/166166" target="_blank" title="在CODE上查看代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/CODE_ico.png" width="12" height="12" alt="在CODE上查看代码片" style="position:relative;top:1px;left:2px;"></a><a href="https://code.csdn.net/snippets/166166/fork" target="_blank" title="派生到我的代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/ico_fork.svg" width="12" height="12" alt="派生到我的代码片" style="position:relative;top:2px;left:2px;"></a><div style="position: absolute; left: 487px; top: 3597px; width: 18px; height: 18px; z-index: 99;"><embed id="ZeroClipboardMovie_13" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="18" height="18" name="ZeroClipboardMovie_13" align="middle" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=13&amp;width=18&amp;height=18" wmode="transparent"></div></div></div><ol start="1" class="dp-j"><li class="alt"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">void</span><span>&nbsp;doFrame(</span><span class="keyword">long</span><span>&nbsp;frameTimeNanos,&nbsp;</span><span class="keyword">int</span><span>&nbsp;frame)&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">synchronized</span><span>&nbsp;(mLock)&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">//省略一些赋值</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">//可能时跳帧的情况，直接调用vsync，并return</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">if</span><span>&nbsp;(frameTimeNanos&nbsp;&lt;&nbsp;mLastFrameTimeNanos)&nbsp;{&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">if</span><span>&nbsp;(DEBUG)&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.d(TAG,&nbsp;<span class="string">"Frame&nbsp;time&nbsp;appears&nbsp;to&nbsp;be&nbsp;going&nbsp;backwards.&nbsp;&nbsp;May&nbsp;be&nbsp;due&nbsp;to&nbsp;a&nbsp;"</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&nbsp;<span class="string">"previously&nbsp;skipped&nbsp;frame.&nbsp;&nbsp;Waiting&nbsp;for&nbsp;next&nbsp;vsync."</span><span>);&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scheduleVsyncLocked();&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">return</span><span>;&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">//先后处理事件回调、动画回调、绘制回调</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;doCallbacks(Choreographer.CALLBACK_INPUT,&nbsp;frameTimeNanos);&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;doCallbacks(Choreographer.CALLBACK_ANIMATION,&nbsp;frameTimeNanos);&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;doCallbacks(Choreographer.CALLBACK_TRAVERSAL,&nbsp;frameTimeNanos);&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li></ol></div><pre code_snippet_id="166166" snippet_file_name="blog_20140122_13_3689686" name="code" class="java" style="display: none;">    void doFrame(long frameTimeNanos, int frame) {

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; synchronized (mLock) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //省略一些赋值
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //可能时跳帧的情况，直接调用vsync，并return
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (frameTimeNanos &lt; mLastFrameTimeNanos) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (DEBUG) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Log.d(TAG, "Frame time appears to be going backwards.&nbsp; May be due to a "
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + "previously skipped frame.&nbsp; Waiting for next vsync.");
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; scheduleVsyncLocked();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; //先后处理事件回调、动画回调、绘制回调
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; doCallbacks(Choreographer.CALLBACK_INPUT, frameTimeNanos);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; doCallbacks(Choreographer.CALLBACK_ANIMATION, frameTimeNanos);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; doCallbacks(Choreographer.CALLBACK_TRAVERSAL, frameTimeNanos);
&nbsp; &nbsp; }
</pre>在do_frame()中判断有跳帧可能性，直接继续vsync。
<p></p>
<p>否则开始新的一帧的绘制，依次处理事件回调、动画回调、绘制回调</p>
<p>在doCallbacks() 中先根据当前时间去除队列中第一个有效的回调，然后依次处理这些回调。</p>
<p></p>
<div class="dp-highlighter bg_java"><div class="bar"><div class="tools"><b>[java]</b> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="ViewSource" title="view plain" onclick="dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;">view plain</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="CopyToClipboard" title="copy" onclick="dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;">copy</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="PrintSource" title="print" onclick="dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;">print</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="About" title="?" onclick="dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;">?</a><a href="https://code.csdn.net/snippets/166166" target="_blank" title="在CODE上查看代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/CODE_ico.png" width="12" height="12" alt="在CODE上查看代码片" style="position:relative;top:1px;left:2px;"></a><a href="https://code.csdn.net/snippets/166166/fork" target="_blank" title="派生到我的代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/ico_fork.svg" width="12" height="12" alt="派生到我的代码片" style="position:relative;top:2px;left:2px;"></a><div style="position: absolute; left: 487px; top: 4148px; width: 18px; height: 18px; z-index: 99;"><embed id="ZeroClipboardMovie_14" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="18" height="18" name="ZeroClipboardMovie_14" align="middle" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=14&amp;width=18&amp;height=18" wmode="transparent"></div></div></div><ol start="1" class="dp-j"><li class="alt"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">void</span><span>&nbsp;doCallbacks(</span><span class="keyword">int</span><span>&nbsp;callbackType,&nbsp;</span><span class="keyword">long</span><span>&nbsp;frameTimeNanos)&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CallbackRecord&nbsp;callbacks;&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">synchronized</span><span>&nbsp;(mLock)&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">//&nbsp;We&nbsp;use&nbsp;"now"&nbsp;to&nbsp;determine&nbsp;when&nbsp;callbacks&nbsp;become&nbsp;due&nbsp;because&nbsp;it's&nbsp;possible</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">//&nbsp;for&nbsp;earlier&nbsp;processing&nbsp;phases&nbsp;in&nbsp;a&nbsp;frame&nbsp;to&nbsp;post&nbsp;callbacks&nbsp;that&nbsp;should&nbsp;run</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="comment">//&nbsp;in&nbsp;a&nbsp;following&nbsp;phase,&nbsp;such&nbsp;as&nbsp;an&nbsp;input&nbsp;event&nbsp;that&nbsp;causes&nbsp;an&nbsp;animation&nbsp;to&nbsp;start.</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">final</span><span>&nbsp;</span><span class="keyword">long</span><span>&nbsp;now&nbsp;=&nbsp;SystemClock.uptimeMillis();&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;span&nbsp;style=<span class="string">"background-color:&nbsp;rgb(102,&nbsp;255,&nbsp;255);"</span><span>&gt;</span><span class="comment">//按时间取队列头&lt;/span&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;callbacks&nbsp;=&nbsp;mCallbackQueues[callbackType].extractDueCallbacksLocked(now);&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">if</span><span>&nbsp;(callbacks&nbsp;==&nbsp;</span><span class="keyword">null</span><span>)&nbsp;{&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">return</span><span>;&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mCallbacksRunning&nbsp;=&nbsp;<span class="keyword">true</span><span>;&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">try</span><span>&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">for</span><span>&nbsp;(CallbackRecord&nbsp;c&nbsp;=&nbsp;callbacks;&nbsp;c&nbsp;!=&nbsp;</span><span class="keyword">null</span><span>;&nbsp;c&nbsp;=&nbsp;c.next)&nbsp;{&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">if</span><span>&nbsp;(DEBUG)&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.d(TAG,&nbsp;<span class="string">"RunCallback:&nbsp;type="</span><span>&nbsp;+&nbsp;callbackType&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&nbsp;<span class="string">",&nbsp;action="</span><span>&nbsp;+&nbsp;c.action&nbsp;+&nbsp;</span><span class="string">",&nbsp;token="</span><span>&nbsp;+&nbsp;c.token&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&nbsp;<span class="string">",&nbsp;latencyMillis="</span><span>&nbsp;+&nbsp;(SystemClock.uptimeMillis()&nbsp;-&nbsp;c.dueTime));&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;span&nbsp;style=<span class="string">"background-color:&nbsp;rgb(51,&nbsp;255,&nbsp;255);"</span><span>&gt;</span><span class="comment">//回调事件</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>&lt;/span&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c.run(frameTimeNanos);&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<span class="keyword">finally</span><span>&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">synchronized</span><span>&nbsp;(mLock)&nbsp;{&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mCallbacksRunning&nbsp;=&nbsp;<span class="keyword">false</span><span>;&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">do</span><span>&nbsp;{&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">final</span><span>&nbsp;CallbackRecord&nbsp;next&nbsp;=&nbsp;callbacks.next;&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;recycleCallbackLocked(callbacks);&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;callbacks&nbsp;=&nbsp;next;&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<span class="keyword">while</span><span>&nbsp;(callbacks&nbsp;!=&nbsp;</span><span class="keyword">null</span><span>);&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li></ol></div><pre code_snippet_id="166166" snippet_file_name="blog_20140122_14_5848493" name="code" class="java" style="display: none;">    void doCallbacks(int callbackType, long frameTimeNanos) {
        CallbackRecord callbacks;
        synchronized (mLock) {
            // We use "now" to determine when callbacks become due because it's possible
            // for earlier processing phases in a frame to post callbacks that should run
            // in a following phase, such as an input event that causes an animation to start.
            final long now = SystemClock.uptimeMillis();
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="background-color: rgb(102, 255, 255);">//按时间取队列头</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; callbacks = mCallbackQueues[callbackType].extractDueCallbacksLocked(now);
            if (callbacks == null) {
                return;
            }
            mCallbacksRunning = true;
        }
        try {
            for (CallbackRecord c = callbacks; c != null; c = c.next) {
                if (DEBUG) {
                    Log.d(TAG, "RunCallback: type=" + callbackType
                            + ", action=" + c.action + ", token=" + c.token
                            + ", latencyMillis=" + (SystemClock.uptimeMillis() - c.dueTime));
                }
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="background-color: rgb(51, 255, 255);">//回调事件
</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; c.run(frameTimeNanos);
            }
        } finally {
            synchronized (mLock) {
                mCallbacksRunning = false;
                do {
                    final CallbackRecord next = callbacks.next;
                    recycleCallbackLocked(callbacks);
                    callbacks = next;
                } while (callbacks != null);
            }
        }
    }</pre><br>
回调的数据结构是CallbackRecord，一个单向链表。根据token 的标志，来回调doframe 或者runnable<br>
<div class="dp-highlighter bg_java"><div class="bar"><div class="tools"><b>[java]</b> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="ViewSource" title="view plain" onclick="dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;">view plain</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="CopyToClipboard" title="copy" onclick="dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;">copy</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="PrintSource" title="print" onclick="dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;">print</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="About" title="?" onclick="dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;">?</a><a href="https://code.csdn.net/snippets/166166" target="_blank" title="在CODE上查看代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/CODE_ico.png" width="12" height="12" alt="在CODE上查看代码片" style="position:relative;top:1px;left:2px;"></a><a href="https://code.csdn.net/snippets/166166/fork" target="_blank" title="派生到我的代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/ico_fork.svg" width="12" height="12" alt="派生到我的代码片" style="position:relative;top:2px;left:2px;"></a><div style="position: absolute; left: 487px; top: 4922px; width: 18px; height: 18px; z-index: 99;"><embed id="ZeroClipboardMovie_15" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="18" height="18" name="ZeroClipboardMovie_15" align="middle" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=15&amp;width=18&amp;height=18" wmode="transparent"></div></div></div><ol start="1" class="dp-j"><li class="alt"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">private</span><span>&nbsp;</span><span class="keyword">static</span><span>&nbsp;</span><span class="keyword">final</span><span>&nbsp;</span><span class="keyword">class</span><span>&nbsp;CallbackRecord&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;CallbackRecord&nbsp;next;&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">long</span><span>&nbsp;dueTime;&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;Object&nbsp;action;&nbsp;</span><span class="comment">//&nbsp;Runnable&nbsp;or&nbsp;FrameCallback</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;Object&nbsp;token;&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">public</span><span>&nbsp;</span><span class="keyword">void</span><span>&nbsp;run(</span><span class="keyword">long</span><span>&nbsp;frameTimeNanos)&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">if</span><span>&nbsp;(token&nbsp;==&nbsp;FRAME_CALLBACK_TOKEN)&nbsp;{&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;((FrameCallback)action).doFrame(frameTimeNanos);&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<span class="keyword">else</span><span>&nbsp;{&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;((Runnable)action).run();&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li></ol></div><pre code_snippet_id="166166" snippet_file_name="blog_20140122_15_2500424" name="code" class="java" style="display: none;">&nbsp;&nbsp;&nbsp; private static final class CallbackRecord {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public CallbackRecord next;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public long dueTime;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public Object action; // Runnable or FrameCallback
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public Object token;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public void run(long frameTimeNanos) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (token == FRAME_CALLBACK_TOKEN) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ((FrameCallback)action).doFrame(frameTimeNanos);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ((Runnable)action).run();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
&nbsp;&nbsp;&nbsp; }</pre>从这里可以看到，处理的事件分为两类：一类是doframe 事件，另一类是runnable 方法。接着，就来看一下到底是加的这些事件。<br>
<p></p>
<h1><a name="t3"></a>3. 哪里会使用Choreographer？</h1>
<p>在《<a target="_blank" href="http://blog.csdn.net/farmer_cc/article/details/18259117">Android 动画animation 深入分析</a><span class="gray"></span>》<a target="_blank" href="http://blog.csdn.net/farmer_cc/article/details/18259117">http://blog.csdn.net/farmer_cc/article/details/18259117</a>中分析到scheduleAnimation
 的时候就是调用的android.view.Choreographer.postCallback(int, Runnable, Object) 方法。查看该方法的调用，在UI 绘制、和其他和动画相关的类中均有调用。这里并没有全部列出来。<br>
</p>
<p>scheduleTraversals() : void - android.view.ViewRootImpl</p>
<p>scheduleAnimation() : void - android.animation.ValueAnimator.AnimationHandler</p>
<p>scheduleAnimationLocked() : void - com.android.server.wm.WindowManagerService</p>
<p>postOnAnimation(Runnable) : void - android.view.View</p>
<p><br>
</p>
<p>在postCallbackDelayedInternal()中 把新来的事件加入到队列中，并根据时间来判断是去frame 还是直接回调<br>
</p>
<p></p>
<div class="dp-highlighter bg_java"><div class="bar"><div class="tools"><b>[java]</b> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="ViewSource" title="view plain" onclick="dp.sh.Toolbar.Command(&#39;ViewSource&#39;,this);return false;">view plain</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="CopyToClipboard" title="copy" onclick="dp.sh.Toolbar.Command(&#39;CopyToClipboard&#39;,this);return false;">copy</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="PrintSource" title="print" onclick="dp.sh.Toolbar.Command(&#39;PrintSource&#39;,this);return false;">print</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="About" title="?" onclick="dp.sh.Toolbar.Command(&#39;About&#39;,this);return false;">?</a><a href="https://code.csdn.net/snippets/166166" target="_blank" title="在CODE上查看代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/CODE_ico.png" width="12" height="12" alt="在CODE上查看代码片" style="position:relative;top:1px;left:2px;"></a><a href="https://code.csdn.net/snippets/166166/fork" target="_blank" title="派生到我的代码片" style="text-indent:0;"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/ico_fork.svg" width="12" height="12" alt="派生到我的代码片" style="position:relative;top:2px;left:2px;"></a><div style="position: absolute; left: 487px; top: 5675px; width: 18px; height: 18px; z-index: 99;"><embed id="ZeroClipboardMovie_16" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="18" height="18" name="ZeroClipboardMovie_16" align="middle" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=16&amp;width=18&amp;height=18" wmode="transparent"></div></div></div><ol start="1" class="dp-j"><li class="alt"><span><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword">private</span><span>&nbsp;</span><span class="keyword">void</span><span>&nbsp;postCallbackDelayedInternal(</span><span class="keyword">int</span><span>&nbsp;callbackType,&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object&nbsp;action,&nbsp;Object&nbsp;token,&nbsp;<span class="keyword">long</span><span>&nbsp;delayMillis)&nbsp;{&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">if</span><span>&nbsp;(DEBUG)&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Log.d(TAG,&nbsp;<span class="string">"PostCallback:&nbsp;type="</span><span>&nbsp;+&nbsp;callbackType&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&nbsp;<span class="string">",&nbsp;action="</span><span>&nbsp;+&nbsp;action&nbsp;+&nbsp;</span><span class="string">",&nbsp;token="</span><span>&nbsp;+&nbsp;token&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&nbsp;<span class="string">",&nbsp;delayMillis="</span><span>&nbsp;+&nbsp;delayMillis);&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">synchronized</span><span>&nbsp;(mLock)&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">final</span><span>&nbsp;</span><span class="keyword">long</span><span>&nbsp;now&nbsp;=&nbsp;SystemClock.uptimeMillis();&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">final</span><span>&nbsp;</span><span class="keyword">long</span><span>&nbsp;dueTime&nbsp;=&nbsp;now&nbsp;+&nbsp;delayMillis;&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;span&nbsp;style=<span class="string">"background-color:&nbsp;rgb(51,&nbsp;255,&nbsp;255);"</span><span>&gt;</span><span class="comment">//&nbsp;入队列&lt;/span&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mCallbackQueues[callbackType].addCallbackLocked(dueTime,&nbsp;action,&nbsp;token);&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="keyword">if</span><span>&nbsp;(dueTime&nbsp;&lt;=&nbsp;now)&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scheduleFrameLocked(now);&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<span class="keyword">else</span><span>&nbsp;{&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;span&nbsp;style=<span class="string">"background-color:&nbsp;rgb(51,&nbsp;255,&nbsp;255);"</span><span>&gt;</span><span class="comment">//&nbsp;直接回调&lt;/span&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Message&nbsp;msg&nbsp;=&nbsp;mHandler.obtainMessage(MSG_DO_SCHEDULE_CALLBACK,&nbsp;action);&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;msg.arg1&nbsp;=&nbsp;callbackType;&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;msg.setAsynchronous(<span class="keyword">true</span><span>);&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mHandler.sendMessageAtTime(msg,&nbsp;dueTime);&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</span></li></ol></div><pre code_snippet_id="166166" snippet_file_name="blog_20140122_16_4899994" name="code" class="java" style="display: none;">    private void postCallbackDelayedInternal(int callbackType,
            Object action, Object token, long delayMillis) {
        if (DEBUG) {
            Log.d(TAG, "PostCallback: type=" + callbackType
                    + ", action=" + action + ", token=" + token
                    + ", delayMillis=" + delayMillis);
        }

        synchronized (mLock) {
            final long now = SystemClock.uptimeMillis();
            final long dueTime = now + delayMillis;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="background-color: rgb(51, 255, 255);">// 入队列</span>
            mCallbackQueues[callbackType].addCallbackLocked(dueTime, action, token);

            if (dueTime &lt;= now) {
                scheduleFrameLocked(now);
            } else {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="background-color: rgb(51, 255, 255);">// 直接回调</span>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Message msg = mHandler.obtainMessage(MSG_DO_SCHEDULE_CALLBACK, action);
                msg.arg1 = callbackType;
                msg.setAsynchronous(true);
                mHandler.sendMessageAtTime(msg, dueTime);
            }
        }</pre><br>
至此，事件的来龙去脉就明确了。Choreographer就是一个消息处理器，根据vsync 信号 来计算frame，而计算frame的方式就是处理三种回调，包括事件回调、动画回调、绘制回调。这三种事件在消息输入、加入动画、准备绘图layout 等动作时均会发给Choreographer。
<p></p>
<p><br>
</p>
<p>写在后面：结合前文《<a target="_blank" href="http://blog.csdn.net/farmer_cc/article/details/18259117">Android 动画animation 深入分析</a><span class="gray"></span>》<a target="_blank" href="http://blog.csdn.net/farmer_cc/article/details/18259117">http://blog.csdn.net/farmer_cc/article/details/18259117</a>中可以更多了解动画相关内容<br>
</p>
    
        <div style="padding-top:20px">         
            <p style="font-size:12px;">版权声明：本文为博主原创文章，未经博主允许不得转载。</p>
        </div>
</div>




<!-- Baidu Button BEGIN -->




<div class="bdsharebuttonbox bdshare-button-style0-16" style="float: right;" data-bd-bind="1439433670598">
<a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="bds_more" data-cmd="more" style="background-position:0 0 !important; background-image: url(http://bdimg.share.baidu.com/static/api/img/share/icons_0_16.png?v=d754dcc0.png) !important"></a>
<a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间" style="background-position:0 -52px !important"></a>
<a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博" style="background-position:0 -104px !important"></a>
<a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博" style="background-position:0 -260px !important"></a>
<a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="bds_renren" data-cmd="renren" title="分享到人人网" style="background-position:0 -208px !important"></a>
<a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" class="bds_weixin" data-cmd="weixin" title="分享到微信" style="background-position:0 -1612px !important"></a>
</div>
<script>window._bd_share_config = { "common": { "bdSnsKey": {}, "bdText": "", "bdMini": "1", "bdMiniList": false, "bdPic": "", "bdStyle": "0", "bdSize": "16" }, "share": {} }; with (document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)];</script>
<!-- Baidu Button END -->

   <link rel="stylesheet" href="http://static.blog.csdn.net/css/blog_detail.css">

    
<!--172.16.140.13-->
<ul class="article_next_prev">
            <li class="prev_article"><span onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_shangyipian&#39;]);location.href=&#39;/farmer_cc/article/details/18600929&#39;;">上一篇</span><a href="http://blog.csdn.net/farmer_cc/article/details/18600929" onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_shangyipian&#39;])">android 多控件顺序翻转动画设计实现</a></li>
            <li class="next_article"><span onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_xiayipian&#39;]);location.href=&#39;/farmer_cc/article/details/19352563&#39;;">下一篇</span><a href="http://blog.csdn.net/farmer_cc/article/details/19352563" onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_xiayipian&#39;])">仿MIUI toast 动画效果实现</a></li>
</ul>

<!-- Baidu Button BEGIN -->
<script type="text/javascript" id="bdshare_js" data="type=tools&amp;uid=1536434" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/bds_s_v2.js"></script>

<script type="text/javascript">
    document.getElementById("bdshell_js").src = "http://bdimg.share.baidu.com/static/js/shell_v2.js?cdnversion=" + Math.ceil(new Date()/3600000)
</script>
<!-- Baidu Button END -->

 

        <div id="digg" articleid="18619429">
            <dl id="btnDigg" class="digg digg_disable">
               
                 <dt>顶</dt>
                <dd>6</dd>
            </dl>
            <dl id="btnBury" class="digg digg_disable">
              
                  <dt>踩</dt>
                <dd>2</dd>
            </dl>
        </div>
      
</div>
<div id="suggest">

    <dl class="blog-associat-tag">
        <dt>主题推荐</dt>
        <dd>
                <a href="http://www.csdn.net/tag/java" target="_blank" class="blog-tage-red">java</a> 
                <a href="http://www.csdn.net/tag/ui" target="_blank" class="blog-tage-red">ui</a> 
                <a href="http://www.csdn.net/tag/%E5%A4%84%E7%90%86%E5%99%A8" target="_blank" class="blog-tage-red">处理器</a> 
                <a href="http://www.csdn.net/tag/%E5%8A%A8%E7%94%BB" target="_blank" class="blog-tage-red">动画</a> 
                <a href="http://www.csdn.net/tag/%E5%B8%83%E5%B1%80" target="_blank" class="blog-tage-red">布局</a> 
                <a href="http://www.csdn.net/tag/%E5%AF%B9%E8%B1%A1" target="_blank" class="blog-tage-red">对象</a> 
                <a href="http://www.csdn.net/tag/%E7%BB%A7%E6%89%BF" target="_blank" class="blog-tage-red">继承</a> 
        </dd>        
    </dl> 
    <span style="display:none" id="tags">java,ui,处理器,动画,布局,对象,继承</span>

</div>
         <script language="javascript" type="text/javascript">     
             $(function(){
                 $.get("/farmer_cc/svc/GetSuggestContent/18619429",function(data){
                     $("#suggest").html(data);
                 });     
             });             
         </script>  


<style>
.blog-ass-articl dd {
color: #369;
width: 99%; /*修改行*/
float: left;
overflow: hidden;
font: normal normal 12px/23px "SimSun";
height: 23px;
margin: 0;
padding: 0 0 0 10px;
margin-right: 30px;
background: url(http://static.blog.csdn.net/skin/default/images/blog-dot-red3.gif) no-repeat 0 10px;
}
</style>

<dl class="blog-ass-articl" id="res-relatived"> 
     <dt><span>猜你在找</span></dt>    


   


    <div id="adCollege" style="width: 42%;float: left;"> 
        <script src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/job_reco.js" type="text/javascript"></script> 
        <script type="text/javascript">
            csdn.position.showEdu({
                sourceType: "blog",
                searchType: "detail",
                searchKey: "18619429",
                username: "",
                recordcount: "5",
                containerId: "adCollege" //容器DIV的id。 
            });
        </script> 
    <div class="tracking-ad" data-mod="popu_84"><dd style="background:url(http://static.blog.csdn.net/skin/default/images/blog-dot-red3.gif) no-repeat 0 10px; white-space: nowrap;"><a href="http://edu.csdn.net/course/detail/202" title="Windows CE车载应用的实现与相关技术点" strategy="content" target="_blank">Windows CE车载应用的实现与相关技术点</a></dd><dd style="background:url(http://static.blog.csdn.net/skin/default/images/blog-dot-red3.gif) no-repeat 0 10px; white-space: nowrap;"><a href="http://edu.csdn.net/course/detail/469" title="Cocos2d-Lua手游开发基础篇" strategy="content" target="_blank">Cocos2d-Lua手游开发基础篇</a></dd><dd style="background:url(http://static.blog.csdn.net/skin/default/images/blog-dot-red3.gif) no-repeat 0 10px; white-space: nowrap;"><a href="http://edu.csdn.net/course/detail/512" title="iOS8-Swift开发教程" strategy="content" target="_blank">iOS8-Swift开发教程</a></dd><dd style="background:url(http://static.blog.csdn.net/skin/default/images/blog-dot-red3.gif) no-repeat 0 10px; white-space: nowrap;"><a href="http://edu.csdn.net/course/detail/532" title="iOS即时通讯(IM)开发实战篇-基于XMPP的聊天软件开发" strategy="content" target="_blank">iOS即时通讯(IM)开发实战篇-基于XMPP的聊天软件开发</a></dd><dd style="background:url(http://static.blog.csdn.net/skin/default/images/blog-dot-red3.gif) no-repeat 0 10px; white-space: nowrap;"><a href="http://edu.csdn.net/course/detail/391" title="深入浅出MySQL入门必备" strategy="hot" target="_blank">深入浅出MySQL入门必备</a></dd></div></div>  

    
     <div id="res" data-mod="popu_36" class="tracking-ad" style="width: 42%; float: left; margin-right: 30px; display: none;"></div>
   
</dl>

<div id="job_blog_reco"><dl class="blog-ass-articl tracking-ad" data-mod="popu_72"><dt><span>准备好了么？&nbsp;<label class="po_blg_detail_tiao">跳</label><label class="po_blg_detail_ba">吧</label><label class="po_blg_detail_th">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;！</label></span><a href="http://job.csdn.net/" target="_blank" class="po_blg_more">更多职位尽在&nbsp;<label class="po_blg_detail_csdn">CSDN JOB</label></a></dt><dd class="po_blg_dd"><div class="po_blg_po"><a href="http://job.csdn.net/Job/Index?jobID=142335" title="核心全栈工程师" strategy="DetailRecommend" target="_blank">核心全栈工程师</a></div><div class="po_blg_company"><a href="http://pr.csdn.net/enterprise/ent_home?orgid=491904" title="北京泛宇精泰科技有限公司" target="_blank">北京泛宇精泰科技有限公司</a></div><label class="po_blg_separator">|</label><div class="po_blg_salary"><a href="http://job.csdn.net/Job/Index?jobID=142335" target="_blank">25-35K/月</a></div><a class="po_blg_iwant" href="http://job.csdn.net/Job/Index?jobID=142335" target="_blank">我要跳槽</a></dd><dd class="po_blg_dd"><div class="po_blg_po"><a href="http://job.csdn.net/Job/Index?jobID=141349" title="资深软件工程师 - 核心网landslide" strategy="DetailRecommend" target="_blank">资深软件工程师 - 核心网landslide</a></div><div class="po_blg_company"><a href="http://pr.csdn.net/enterprise/ent_home?orgid=358194" title="思博伦通信科技（北京）有限公司" target="_blank">思博伦通信科技（北京）有限公司</a></div><label class="po_blg_separator">|</label><div class="po_blg_salary"><a href="http://job.csdn.net/Job/Index?jobID=141349" target="_blank">20-25K/月</a></div><a class="po_blg_iwant" href="http://job.csdn.net/Job/Index?jobID=141349" target="_blank">我要跳槽</a></dd><dd class="po_blg_dd"><div class="po_blg_po"><a href="http://job.csdn.net/Job/Index?jobID=142425" title="UI设计师" strategy="DetailRecommend" target="_blank">UI设计师</a></div><div class="po_blg_company"><a href="http://pr.csdn.net/enterprise/ent_home?orgid=492270" title="石家庄依顿商贸有限公司" target="_blank">石家庄依顿商贸有限公司</a></div><label class="po_blg_separator">|</label><div class="po_blg_salary"><a href="http://job.csdn.net/Job/Index?jobID=142425" target="_blank">12-20K/月</a></div><a class="po_blg_iwant" href="http://job.csdn.net/Job/Index?jobID=142425" target="_blank">我要跳槽</a></dd><dd class="po_blg_dd"><div class="po_blg_po"><a href="http://job.csdn.net/Job/Index?jobID=142740" title="UI设计师" strategy="DetailRecommend" target="_blank">UI设计师</a></div><div class="po_blg_company"><a href="http://pr.csdn.net/enterprise/ent_home?orgid=492326" title="北京金元瑞驰汽车俱乐部有限公司" target="_blank">北京金元瑞驰汽车俱乐部有限公司</a></div><label class="po_blg_separator">|</label><div class="po_blg_salary"><a href="http://job.csdn.net/Job/Index?jobID=142740" target="_blank">7-9K/月</a></div><a class="po_blg_iwant" href="http://job.csdn.net/Job/Index?jobID=142740" target="_blank">我要跳槽</a></dd></dl></div>

<script type="text/javascript">
    $(function () {
        setTimeout(function () {
            var searchtitletags = '深入分析UI 上层事件处理核心机制 Choreographer' + ',' + $("#tags").html();
            searchService({
                index: 'blog',
                query: searchtitletags,
                from: 5,
                size: 5,
                appendTo: '#res',
                url: 'recommend',
                his: 2,
                client: "blog_cf_enhance",
                tmpl: '<dd style="background:url(http://static.blog.csdn.net/skin/default/images/blog-dot-red3.gif) no-repeat 0 10px;"><a href="#{ url }" title="#{ title }" strategy="#{ strategy }">#{ title }</a></dd>'
            });
        }, 500);
    });    

 </script>   

    <div id="ad_cen">
   
          <script type="text/javascript">
              new Ad(4, 'ad_cen');
          </script>
    <iframe id="ad_frm_0" frameborder="0" scrolling="no" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/ad(1).html" style="border-width: 0px; overflow: hidden; width: 746px; height: 90px;"></iframe></div>
<div class="comment_class">
    <div id="comment_title" class="panel_head">
        <span class="see_comment">查看评论</span><a name="comments"></a></div>
    <div id="comment_list"><dl class="comment_item comment_topic" id="comment_item_4735481"><dt class="comment_head" floor="4">4楼 <span class="user"><a class="username" href="http://blog.csdn.net/gcqjiayou" target="_blank">甘奇飞</a> <span class="ptime">2015-01-24 20:01发表</span>  <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="4735481" username="gcqjiayou"> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/gcqjiayou" target="_blank"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/3_gcqjiayou.jpg" width="40" height="40"></a></dd><dd class="comment_body">赞一个，感谢分享~</dd></dl><dl class="comment_item comment_topic" id="comment_item_4610375"><dt class="comment_head" floor="3">3楼 <span class="user"><a class="username" href="http://blog.csdn.net/sky88088" target="_blank">sky88088</a> <span class="ptime">2014-12-15 13:24发表</span>  <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="4610375" username="sky88088"> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/sky88088" target="_blank"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/3_sky88088.jpg" width="40" height="40"></a></dd><dd class="comment_body">请教一下，onVsync方法应该是每次产生Vsync信号的时候被调用的吧？因为参数是具体的时间和Frame<br>如果是这样的话，为什么不直接在onVsync里调用doCallbacks方法，而是还要将自己加入消息队列来通过异步调用呢？<br>额外的这一层具体有什么考究吗？</dd><dl class="comment_item comment_reply" id="comment_item_4611535"><dt class="comment_head" floor="3">Re: <span class="user"><a class="username" href="http://blog.csdn.net/farmer_cc" target="_blank">farmer_cc</a> <span class="ptime">2014-12-15 20:14发表</span>  <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="4611535" username="farmer_cc"> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/farmer_cc" target="_blank"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/3_farmer_cc.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复sky88088：doCallbacks 并不能保证一定能在一个sync 时间内完成。 通过异步方法，一方面onsync 不会被阻塞。 一方面提供了合并doCallbacks 操作的机制。</dd></dl><dl class="comment_item comment_reply" id="comment_item_4611533"><dt class="comment_head" floor="3">Re: <span class="user"><a class="username" href="http://blog.csdn.net/farmer_cc" target="_blank">farmer_cc</a> <span class="ptime">2014-12-15 20:14发表</span>  <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="4611533" username="farmer_cc"> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/farmer_cc" target="_blank"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/3_farmer_cc.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复sky88088：doCallbacks 并不能保证一定能在一个sync 时间内完成。 通过异步方法，一方面onsync 不会被阻塞。 一方面提供了合并doCallbacks 操作的机制。</dd><dl class="comment_item comment_reply" id="comment_item_4618561"><dt class="comment_head" floor="2">Re: <span class="user"><a class="username" href="http://blog.csdn.net/sky88088" target="_blank">sky88088</a> <span class="ptime">2014-12-18 09:47发表</span>  <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="4618561" username="sky88088"> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/sky88088" target="_blank"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/3_sky88088.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复farmer_cc：嗯，不阻塞onVsync确实是一个考虑</dd><dl class="comment_item comment_reply" id="comment_item_4621581"><dt class="comment_head" floor="1">Re: <span class="user"><a class="username" href="http://blog.csdn.net/farmer_cc" target="_blank">farmer_cc</a> <span class="ptime">2014-12-19 12:52发表</span>  <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="4621581" username="farmer_cc"> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/farmer_cc" target="_blank"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/3_farmer_cc.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复sky88088：恩，我理解是这么个道理</dd></dl></dl></dl></dl><dl class="comment_item comment_topic" id="comment_item_3430025"><dt class="comment_head" floor="2">2楼 <span class="user"><a class="username" href="http://blog.csdn.net/suannai0314" target="_blank">鹳狸媛</a> <span class="ptime">2014-01-23 16:30发表</span>  <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="3430025" username="suannai0314"> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/suannai0314" target="_blank"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/3_suannai0314.jpg" width="40" height="40"></a></dd><dd class="comment_body">您的文章已被推荐到博客首页和个人页侧边栏推荐文章，感谢您的分享。</dd></dl><dl class="comment_item comment_topic" id="comment_item_3425183"><dt class="comment_head" floor="1">1楼 <span class="user"><a class="username" href="http://blog.csdn.net/u013536421" target="_blank">博恩</a> <span class="ptime">2014-01-22 09:57发表</span>  <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="3425183" username="u013536421"> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/u013536421" target="_blank"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/3_u013536421.jpg" width="40" height="40"></a></dd><dd class="comment_body">吃药打酱油签到下～</dd><dl class="comment_item comment_reply" id="comment_item_3428309"><dt class="comment_head" floor="1">Re: <span class="user"><a class="username" href="http://blog.csdn.net/farmer_cc" target="_blank">farmer_cc</a> <span class="ptime">2014-01-23 09:37发表</span>  <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#reply" class="cmt_btn reply" title="回复">[回复]</a> <span class="comment_manage" style="display:none;" commentid="3428309" username="farmer_cc"> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#quote" class="cmt_btn quote" title="引用">[引用]</a> <a href="http://blog.csdn.net/farmer_cc/article/details/18619429#report" class="cmt_btn report" title="举报">[举报]</a></span></span></dt><dd class="comment_userface"><a href="http://blog.csdn.net/farmer_cc" target="_blank"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/3_farmer_cc.jpg" width="40" height="40"></a></dd><dd class="comment_body">回复u013536421：^_^</dd></dl></dl><div class="clear"></div></div>
    <div id="comment_bar" style="display: none;">
    </div>
    <div id="comment_form"><div class="guest_link">您还没有登录,请<a href="javascript:void(0);" onclick="javascript:loginbox();">[登录]</a>或<a href="http://passport.csdn.net/account/register?from=http%3A%2F%2Fblog.csdn.net%2Ffarmer_cc%2Farticle%2Fdetails%2F18619429">[注册]</a></div></div>

    <div class="announce">
        * 以上用户言论只代表其个人观点，不代表CSDN网站的观点或立场<a name="reply"></a><a name="quote"></a></div>
</div>

<script type="text/javascript">
    var fileName = '18619429';
    var commentscount = 9;
    var islock = false
</script>
<script type="text/javascript" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/comment.js"></script>
    <div id="ad_bot">
    <iframe id="ad_frm_2" frameborder="0" scrolling="no" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/ad(2).html" style="border-width: 0px; overflow: hidden; width: 746px; height: 200px;"></iframe></div>
    <script type="text/javascript">
        setTimeout(function(){
            new Ad(5, 'ad_bot');
        },500);  
    </script>
<div id="report_dialog">
</div>

<div id="d-top" style="bottom:60px;">
        <a id="quick-reply" class="btn btn-top q-reply" title="快速回复" style="display:none;">
            <img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/blog-icon-reply.png" alt="快速回复">
        </a>    

    <a id="d-top-a" class="btn btn-top backtop" style="display: none;" title="返回顶部" onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_huidaodingbu&#39;])">         
         <img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/top.png" alt="TOP">
    </a>
</div>
<script type="text/javascript">
    $(function ()
    {
        $("#ad_frm_0").height("90px");
        
        setTimeout(function(){
            $("#ad_frm_2").height("200px");
        },1000);    
    });
  
</script>
<style type="text/css">
    .tag_list
    {
        background: none repeat scroll 0 0 #FFFFFF;
        border: 1px solid #D7CBC1;
        color: #000000;
        font-size: 12px;
        line-height: 20px;
        list-style: none outside none;
        margin: 10px 2% 0 1%;
        padding: 1px;
    }
    .tag_list h5
    {
        background: none repeat scroll 0 0 #E0DBD3;
        color: #47381C;
        font-size: 12px;
        height: 24px;
        line-height: 24px;
        padding: 0 5px;
        margin: 0;
    }
    .tag_list h5 a
    {
        color: #47381C;
    }
    .classify
    {
        margin: 10px 0;
        padding: 4px 12px 8px;
    }
    .classify a
    {
        margin-right: 20px;
        white-space: nowrap;
    }
</style>


<div class="tag_list" style="">

    <h5>
        <a href="http://www.csdn.net/tag/" target="_blank">核心技术类目</a></h5>
    <div class="classify">
<a title="全部主题" href="http://www.csdn.net/tag" target="_blank" onclick="LogClickCount(this,336);">全部主题</a>
<a title="Hadoop" href="http://g.csdn.net/5272865" target="_blank" onclick="LogClickCount(this,336);">Hadoop</a>
<a title="AWS" href="http://g.csdn.net/5272866" target="_blank" onclick="LogClickCount(this,336);">AWS</a>
<a title="移动游戏" href="http://g.csdn.net/5272870" target="_blank" onclick="LogClickCount(this,336);">移动游戏</a>
<a title="Java" href="http://g.csdn.net/5272871" target="_blank" onclick="LogClickCount(this,336);">Java</a>
<a title="Android" href="http://g.csdn.net/5272872" target="_blank" onclick="LogClickCount(this,336);">Android</a>
<a title="iOS" href="http://g.csdn.net/5272873" target="_blank" onclick="LogClickCount(this,336);">iOS</a>
<a title="Swift" href="http://g.csdn.net/5272868" target="_blank" onclick="LogClickCount(this,336);">Swift</a>
<a title="智能硬件" href="http://g.csdn.net/5272869" target="_blank" onclick="LogClickCount(this,336);">智能硬件</a>
<a title="Docker" href="http://g.csdn.net/5272867" target="_blank" onclick="LogClickCount(this,336);">Docker</a>
<a title="OpenStack" href="http://g.csdn.net/5272925" target="_blank" onclick="LogClickCount(this,336);">OpenStack</a>
<a title="VPN" href="http://www.csdn.net/tag/vpn" target="_blank" onclick="LogClickCount(this,336);">VPN</a>
<a title="Spark" href="http://g.csdn.net/5272924" target="_blank" onclick="LogClickCount(this,336);">Spark</a>
<a title="ERP" href="http://www.csdn.net/tag/erp" target="_blank" onclick="LogClickCount(this,336);">ERP</a>
<a title="IE10" href="http://www.csdn.net/tag/ie10" target="_blank" onclick="LogClickCount(this,336);">IE10</a>
<a title="Eclipse" href="http://www.csdn.net/tag/eclipse" target="_blank" onclick="LogClickCount(this,336);">Eclipse</a>
<a title="CRM" href="http://www.csdn.net/tag/crm" target="_blank" onclick="LogClickCount(this,336);">CRM</a>
<a title="JavaScript" href="http://www.csdn.net/tag/javascript" target="_blank" onclick="LogClickCount(this,336);">JavaScript</a>
<a title="数据库" href="http://www.csdn.net/tag/%E6%95%B0%E6%8D%AE%E5%BA%93" target="_blank" onclick="LogClickCount(this,336);">数据库</a>
<a title="Ubuntu" href="http://www.csdn.net/tag/ubuntu" target="_blank" onclick="LogClickCount(this,336);">Ubuntu</a>
<a title="NFC" href="http://www.csdn.net/tag/nfc" target="_blank" onclick="LogClickCount(this,336);">NFC</a>
<a title="WAP" href="http://www.csdn.net/tag/wap" target="_blank" onclick="LogClickCount(this,336);">WAP</a>
<a title="jQuery" href="http://www.csdn.net/tag/jquery" target="_blank" onclick="LogClickCount(this,336);">jQuery</a>
<a title="BI" href="http://www.csdn.net/tag/bi" target="_blank" onclick="LogClickCount(this,336);">BI</a>
<a title="HTML5" href="http://www.csdn.net/tag/html5" target="_blank" onclick="LogClickCount(this,336);">HTML5</a>
<a title="Spring" href="http://www.csdn.net/tag/spring" target="_blank" onclick="LogClickCount(this,336);">Spring</a>
<a title="Apache" href="http://www.csdn.net/tag/apache" target="_blank" onclick="LogClickCount(this,336);">Apache</a>
<a title=".NET" href="http://www.csdn.net/tag/.net" target="_blank" onclick="LogClickCount(this,336);">.NET</a>
<a title="API" href="http://www.csdn.net/tag/api" target="_blank" onclick="LogClickCount(this,336);">API</a>
<a title="HTML" href="http://www.csdn.net/tag/html" target="_blank" onclick="LogClickCount(this,336);">HTML</a>
<a title="SDK" href="http://www.csdn.net/tag/sdk" target="_blank" onclick="LogClickCount(this,336);">SDK</a>
<a title="IIS" href="http://www.csdn.net/tag/iis" target="_blank" onclick="LogClickCount(this,336);">IIS</a>
<a title="Fedora" href="http://www.csdn.net/tag/fedora" target="_blank" onclick="LogClickCount(this,336);">Fedora</a>
<a title="XML" href="http://www.csdn.net/tag/xml" target="_blank" onclick="LogClickCount(this,336);">XML</a>
<a title="LBS" href="http://www.csdn.net/tag/lbs" target="_blank" onclick="LogClickCount(this,336);">LBS</a>
<a title="Unity" href="http://www.csdn.net/tag/unity" target="_blank" onclick="LogClickCount(this,336);">Unity</a>
<a title="Splashtop" href="http://www.csdn.net/tag/splashtop" target="_blank" onclick="LogClickCount(this,336);">Splashtop</a>
<a title="UML" href="http://www.csdn.net/tag/uml" target="_blank" onclick="LogClickCount(this,336);">UML</a>
<a title="components" href="http://www.csdn.net/tag/components" target="_blank" onclick="LogClickCount(this,336);">components</a>
<a title="Windows Mobile" href="http://www.csdn.net/tag/windowsmobile" target="_blank" onclick="LogClickCount(this,336);">Windows Mobile</a>
<a title="Rails" href="http://www.csdn.net/tag/rails" target="_blank" onclick="LogClickCount(this,336);">Rails</a>
<a title="QEMU" href="http://www.csdn.net/tag/qemu" target="_blank" onclick="LogClickCount(this,336);">QEMU</a>
<a title="KDE" href="http://www.csdn.net/tag/kde" target="_blank" onclick="LogClickCount(this,336);">KDE</a>
<a title="Cassandra" href="http://www.csdn.net/tag/cassandra" target="_blank" onclick="LogClickCount(this,336);">Cassandra</a>
<a title="CloudStack" href="http://www.csdn.net/tag/cloudstack" target="_blank" onclick="LogClickCount(this,336);">CloudStack</a>
<a title="FTC" href="http://www.csdn.net/tag/ftc" target="_blank" onclick="LogClickCount(this,336);">FTC</a>
<a title="coremail" href="http://www.csdn.net/tag/coremail" target="_blank" onclick="LogClickCount(this,336);">coremail</a>
<a title="OPhone " href="http://www.csdn.net/tag/ophone" target="_blank" onclick="LogClickCount(this,336);">OPhone </a>
<a title="CouchBase" href="http://www.csdn.net/tag/couchbase" target="_blank" onclick="LogClickCount(this,336);">CouchBase</a>
<a title="云计算" href="http://www.csdn.net/tag/%E4%BA%91%E8%AE%A1%E7%AE%97" target="_blank" onclick="LogClickCount(this,336);">云计算</a>
<a title="iOS6" href="http://www.csdn.net/tag/iOS6" target="_blank" onclick="LogClickCount(this,336);">iOS6</a>
<a title="Rackspace " href="http://www.csdn.net/tag/rackspace" target="_blank" onclick="LogClickCount(this,336);">Rackspace </a>
<a title="Web App" href="http://www.csdn.net/tag/webapp" target="_blank" onclick="LogClickCount(this,336);">Web App</a>
<a title="SpringSide" href="http://www.csdn.net/tag/springside" target="_blank" onclick="LogClickCount(this,336);">SpringSide</a>
<a title="Maemo" href="http://www.csdn.net/tag/maemo" target="_blank" onclick="LogClickCount(this,336);">Maemo</a>
<a title="Compuware" href="http://www.csdn.net/tag/compuware" target="_blank" onclick="LogClickCount(this,336);">Compuware</a>
<a title="大数据" href="http://www.csdn.net/tag/%E5%A4%A7%E6%95%B0%E6%8D%AE" target="_blank" onclick="LogClickCount(this,336);">大数据</a>
<a title="aptech" href="http://www.csdn.net/tag/aptech" target="_blank" onclick="LogClickCount(this,336);">aptech</a>
<a title="Perl" href="http://www.csdn.net/tag/perl" target="_blank" onclick="LogClickCount(this,336);">Perl</a>
<a title="Tornado" href="http://www.csdn.net/tag/tornado" target="_blank" onclick="LogClickCount(this,336);">Tornado</a>
<a title="Ruby" href="http://www.csdn.net/tag/ruby" target="_blank" onclick="LogClickCount(this,336);">Ruby</a>
<a title="Hibernate" href="http://www.csdn.net/hibernate" target="_blank" onclick="LogClickCount(this,336);">Hibernate</a>
<a title="ThinkPHP" href="http://www.csdn.net/tag/thinkphp" target="_blank" onclick="LogClickCount(this,336);">ThinkPHP</a>
<a title="HBase" href="http://www.csdn.net/tag/hbase" target="_blank" onclick="LogClickCount(this,336);">HBase</a>
<a title="Pure" href="http://www.csdn.net/tag/pure" target="_blank" onclick="LogClickCount(this,336);">Pure</a>
<a title="Solr" href="http://www.csdn.net/tag/solr" target="_blank" onclick="LogClickCount(this,336);">Solr</a>
<a title="Angular" href="http://www.csdn.net/tag/angular" target="_blank" onclick="LogClickCount(this,336);">Angular</a>
<a title="Cloud Foundry" href="http://www.csdn.net/tag/cloudfoundry" target="_blank" onclick="LogClickCount(this,336);">Cloud Foundry</a>
<a title="Redis" href="http://www.csdn.net/tag/redis" target="_blank" onclick="LogClickCount(this,336);">Redis</a>
<a title="Scala" href="http://www.csdn.net/tag/scala" target="_blank" onclick="LogClickCount(this,336);">Scala</a>
<a title="Django" href="http://www.csdn.net/tag/django" target="_blank" onclick="LogClickCount(this,336);">Django</a>
<a title="Bootstrap" href="http://www.csdn.net/tag/bootstrap" target="_blank" onclick="LogClickCount(this,336);">Bootstrap</a>
    </div>

</div>
  <script language="javascript" type="text/javascript">     
      $(function(){
              setTimeout(function(){
                  $.get("/farmer_cc/svc/GetTagContent",function(data){
                      $(".tag_list").html(data).show();
                  });     
              });
          },500);                       
 </script> 


<div id="pop_win" style="display:none ;position: absolute; z-index: 10000; border: 1px solid rgb(220, 220, 220); top: 222.5px; left: 630px; opacity: 1; background: none 0px 0px repeat scroll rgb(255, 255, 255);">
    
</div>
<div id="popup_mask"></div>
<style>
    #popup_mask
    {
        position: absolute;
        width: 100%;
        height: 100%;
        background: #000;
        z-index: 9999;
        left: 0px;
        top: 0px;
        opacity: 0.3;
        filter: alpha(opacity=30);
        display: none;
    }

</style>




<script type="text/javascript">
    $(function(){
        setTimeout(function(){
            $(".comment_body:contains('回复')").each(function(index,item){
                var u=$(this).text().split('：')[0].toString().replace("回复","")
                var thisComment=$(this);
                if(u)
                {
                    $.getJSON("https://passport.csdn.net/get/nick?callback=?", {users: u}, function(a) {
                        if(a!=null&&a.data!=null&&a.data.length>0)
                        {
                            nick=a.data[0].n; 
                            if(u!=nick)
                            {
                                thisComment.text(thisComment.text().replace(u,nick));  
                            }
                        }       
                    });  
                }
            });
        },200);  
        
        setTimeout(function(){
            $("a img[src='http://js.tongji.linezing.com/stats.gif']").parent().css({"position":"absolute","left":"50%"});
        },300);
    });

    function loginbox(){
        var $logpop=$("#pop_win");
        $logpop.html('<iframe src="https://passport.csdn.net/account/loginbox?service=http://static.blog.csdn.net/callback.htm" frameborder="0" height="600" width="400" scrolling="no"></iframe>');

        $('#popup_mask').css({
            opacity: 0.5,
            width: $( document ).width() + 'px',
            height:  $( document ).height() + 'px'
        });
        $('#popup_mask').css("display","block");
 
        $logpop.css( {
            top: ($( window ).height() - $logpop.height())/ 2  + $( window 
       ).scrollTop() + 'px',
            left:($( window ).width() - $logpop.width())/ 2
        } );
 
        setTimeout( function () {
            $logpop.show();
            $logpop.css( {
                opacity: 1
            } );
        }, 200 );
 
        $('#popup_mask').unbind("click");
        $('#popup_mask').bind("click", function(){
            $('#popup_mask').hide();
            var $clopop = $("#pop_win");
            $("#common_ask_div_sc").css("display","none");
            $clopop.css( {
                opacity: 0
            } );
            setTimeout( function () {
                $clopop.hide();
            }, 350 );
            return false;
        });
    }    

</script>
                        <div class="clear">
                        </div>
                    </div>                   
                
            </div>
                   
           <div id="side">
    <div class="side">
<div id="panel_Profile" class="panel">
<ul class="panel_head"><span>个人资料</span></ul>
<ul class="panel_body profile">
<div id="blog_userface">
    <a href="http://my.csdn.net/farmer_cc" target="_blank">
    <img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/1_farmer_cc.jpg" title="访问我的空间" style="max-width:90%">
    </a>
    <br>
    <span><a href="http://my.csdn.net/farmer_cc" class="user_name" target="_blank">farmer_cc</a></span>
</div>
<div class="interact">

    <a href="javascript:void(0);" class="attent" id="span_add_follow" title="[加关注]"></a>

 <a href="javascript:void(0);" class="letter" title="[发私信]" onclick="window.open(&#39;http://msg.csdn.net/letters/model?receiver=farmer_cc&#39;,&#39;_blank&#39;,&#39;height=350,width=700&#39;);_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_sixin&#39;])"></a>  
</div>
<div id="blog_medal">
                <div id="bms_box">
               </div>
</div>
<ul id="blog_rank">
    <li>访问：<span>59867次</span></li>
    <li>积分：<span>917</span> </li>    
    <li>等级： <span style="position:relative;display:inline-block;z-index:1">
            <img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/blog3.png" alt="" style="vertical-align: middle;" id="leveImg">
            <div id="smallTittle" style=" position: absolute;  left: -24px;  top: 25px;  text-align: center;  width: 101px;  height: 32px;  background-color: #fff;  line-height: 32px;  border: 2px #DDDDDD solid;  box-shadow: 0px 2px 2px rgba (0,0,0,0.1);  display: none;   z-index: 999;">
            <div style="left: 42%;  top: -8px;  position: absolute;  width: 0;  height: 0;  border-left: 10px solid transparent;  border-right: 10px solid transparent;  border-bottom: 8px solid #EAEAEA;"></div>
            积分：917 </div>
        </span>  </li>
    <li>排名：<span>千里之外</span></li>
</ul>
<ul id="blog_statistics">
    <li>原创：<span>26篇</span></li>
    <li>转载：<span>6篇</span></li>
    <li>译文：<span>1篇</span></li>
    <li>评论：<span>53条</span></li>
</ul>
</ul>
</div>


<div class="panel" id="panel_Search">
    <ul class="panel_head"><span>文章搜索</span></ul>
    <ul class="panel_body">
        <form id="frmSearch" action="http://so.csdn.net/search" class="form_search" target="_blank">
        <span><input id="inputSearch" type="text" class="blogsearch" title="请输入关键字"></span>
        <input id="btnSubmit" type="button" value="搜索" title="search in blog">
        <input type="hidden" name="q" id="inputQ">
        <input type="hidden" name="t" value="blog">
        <a id="btnSearchBlog" target="_blank"></a>
        </form>
    </ul>
</div>

<script type="text/javascript">
    $(function () {
        $("#btnSubmit").click(function () {           
            search();
        });

        $("#frmSearch").submit(function () {
            search();
            return false;
        });

        function search()
        {
            var url = "http://so.csdn.net/so/search/s.do?q=" + encodeURIComponent($("#inputSearch").val()) + "&u=" + username + "&t=blog";
            window.location.href = url;
        }   
    });
</script><div id="panel_Category" class="panel">
<ul class="panel_head"><span>文章分类</span></ul>
<ul class="panel_body">    
                 <li>
                    <a href="http://blog.csdn.net/farmer_cc/article/category/683683" onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_wenzhangfenlei&#39;]); ">Android相关</a><span>(14)</span>
                </li>
                 <li>
                    <a href="http://blog.csdn.net/farmer_cc/article/category/1866853" onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_wenzhangfenlei&#39;]); ">动画</a><span>(5)</span>
                </li>
                 <li>
                    <a href="http://blog.csdn.net/farmer_cc/article/category/2359991" onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_wenzhangfenlei&#39;]); ">Android Design</a><span>(0)</span>
                </li>
                 <li>
                    <a href="http://blog.csdn.net/farmer_cc/article/category/2334741" onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_wenzhangfenlei&#39;]); ">界面相关</a><span>(3)</span>
                </li>
                 <li>
                    <a href="http://blog.csdn.net/farmer_cc/article/category/2334739" onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_wenzhangfenlei&#39;]); ">framework</a><span>(3)</span>
                </li>
                 <li>
                    <a href="http://blog.csdn.net/farmer_cc/article/category/683684" onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_wenzhangfenlei&#39;]); ">java技术文章</a><span>(1)</span>
                </li>
                 <li>
                    <a href="http://blog.csdn.net/farmer_cc/article/category/2767489" onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_wenzhangfenlei&#39;]); ">python</a><span>(0)</span>
                </li>
                 <li>
                    <a href="http://blog.csdn.net/farmer_cc/article/category/708596" onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_wenzhangfenlei&#39;]); ">ldd</a><span>(1)</span>
                </li>
                 <li>
                    <a href="http://blog.csdn.net/farmer_cc/article/category/695399" onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_wenzhangfenlei&#39;]); ">杂感</a><span>(2)</span>
                </li>
                 <li>
                    <a href="http://blog.csdn.net/farmer_cc/article/category/694547" onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_wenzhangfenlei&#39;]); ">读书</a><span>(3)</span>
                </li>
                 <li>
                    <a href="http://blog.csdn.net/farmer_cc/article/category/2360029" onclick="_gaq.push([&#39;_trackEvent&#39;,&#39;function&#39;, &#39;onclick&#39;, &#39;blog_articles_wenzhangfenlei&#39;]); ">效率</a><span>(1)</span>
                </li>
</ul>
</div><div id="panel_Archive" class="panel">
<ul class="panel_head"><span>文章存档</span></ul>
<ul class="panel_body">
<div id="archive_list"><li><a href="http://blog.csdn.net/farmer_cc/article/month/2015/01">2015年01月</a><span>(1)</span></li><li><a href="http://blog.csdn.net/farmer_cc/article/month/2014/12">2014年12月</a><span>(2)</span></li><li><a href="http://blog.csdn.net/farmer_cc/article/month/2014/06">2014年06月</a><span>(5)</span></li><li><a href="http://blog.csdn.net/farmer_cc/article/month/2014/02">2014年02月</a><span>(1)</span></li><li><a href="http://blog.csdn.net/farmer_cc/article/month/2014/01">2014年01月</a><span>(8)</span></li><span class="hidelist" style="display:none;"><li><a href="http://blog.csdn.net/farmer_cc/article/month/2010/07">2010年07月</a><span>(5)</span></li><li><a href="http://blog.csdn.net/farmer_cc/article/month/2010/06">2010年06月</a><span>(6)</span></li><li><a href="http://blog.csdn.net/farmer_cc/article/month/2010/05">2010年05月</a><span>(5)</span></li></span><div id="archive_list_button" class="list_closed">展开</div></div>
</ul>
</div>
<div id="hotarticls" class="panel">
<ul class="panel_head">
    <span>       
阅读排行    </span>
</ul>

<ul class="panel_body itemlist">
<li>
<a href="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET.html" title="深入分析UI 上层事件处理核心机制 Choreographer">深入分析UI 上层事件处理核心机制 Choreographer</a><span>(9295)</span>
</li>
<li>
<a href="http://blog.csdn.net/farmer_cc/article/details/18259117" title="Android 动画animation 深入分析">Android 动画animation 深入分析</a><span>(6864)</span>
</li>
<li>
<a href="http://blog.csdn.net/farmer_cc/article/details/18551657" title="android 点击效果动画增强">android 点击效果动画增强</a><span>(4481)</span>
</li>
<li>
<a href="http://blog.csdn.net/farmer_cc/article/details/31454803" title="源码分析：onAttach, onMeasure, onLayout, onDraw 的顺序。">源码分析：onAttach, onMeasure, onLayout, onDraw 的顺序。</a><span>(3844)</span>
</li>
<li>
<a href="http://blog.csdn.net/farmer_cc/article/details/19352563" title="仿MIUI toast 动画效果实现">仿MIUI toast 动画效果实现</a><span>(3525)</span>
</li>
<li>
<a href="http://blog.csdn.net/farmer_cc/article/details/30800229" title="源码分析:LayoutParams的wrap_content, match_parent, 和具体值">源码分析:LayoutParams的wrap_content, match_parent, 和具体值</a><span>(3517)</span>
</li>
<li>
<a href="http://blog.csdn.net/farmer_cc/article/details/18403001" title="android 点击下弹动画实现">android 点击下弹动画实现</a><span>(3268)</span>
</li>
<li>
<a href="http://blog.csdn.net/farmer_cc/article/details/18600929" title="android 多控件顺序翻转动画设计实现">android 多控件顺序翻转动画设计实现</a><span>(3039)</span>
</li>
<li>
<a href="http://blog.csdn.net/farmer_cc/article/details/30968459" title="源码解析：dialog, popupwindow, 和activity 的第一个view是怎么来的？">源码解析：dialog, popupwindow, 和activity 的第一个view是怎么来的？</a><span>(2188)</span>
</li>
<li>
<a href="http://blog.csdn.net/farmer_cc/article/details/5573509" title="TelephonyProvider 分析">TelephonyProvider 分析</a><span>(1997)</span>
</li>
</ul>
</div>
<div id="hotarticls2" class="panel">
<ul class="panel_head"><span>评论排行</span></ul>
<ul class="panel_body itemlist">
<li>
<a href="http://blog.csdn.net/farmer_cc/article/details/18259117" title="Android 动画animation 深入分析">Android 动画animation 深入分析</a><span>(11)</span>
</li>
<li>
<a href="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET.html" title="深入分析UI 上层事件处理核心机制 Choreographer">深入分析UI 上层事件处理核心机制 Choreographer</a><span>(9)</span>
</li>
<li>
<a href="http://blog.csdn.net/farmer_cc/article/details/30968459" title="源码解析：dialog, popupwindow, 和activity 的第一个view是怎么来的？">源码解析：dialog, popupwindow, 和activity 的第一个view是怎么来的？</a><span>(8)</span>
</li>
<li>
<a href="http://blog.csdn.net/farmer_cc/article/details/19352563" title="仿MIUI toast 动画效果实现">仿MIUI toast 动画效果实现</a><span>(7)</span>
</li>
<li>
<a href="http://blog.csdn.net/farmer_cc/article/details/18403001" title="android 点击下弹动画实现">android 点击下弹动画实现</a><span>(5)</span>
</li>
<li>
<a href="http://blog.csdn.net/farmer_cc/article/details/18551657" title="android 点击效果动画增强">android 点击效果动画增强</a><span>(4)</span>
</li>
<li>
<a href="http://blog.csdn.net/farmer_cc/article/details/18562683" title="android Pull-to-refresh 动画实现">android Pull-to-refresh 动画实现</a><span>(3)</span>
</li>
<li>
<a href="http://blog.csdn.net/farmer_cc/article/details/42305561" title="迟到的年终总结，2012-2014">迟到的年终总结，2012-2014</a><span>(2)</span>
</li>
<li>
<a href="http://blog.csdn.net/farmer_cc/article/details/5573509" title="TelephonyProvider 分析">TelephonyProvider 分析</a><span>(1)</span>
</li>
<li>
<a href="http://blog.csdn.net/farmer_cc/article/details/18600929" title="android 多控件顺序翻转动画设计实现">android 多控件顺序翻转动画设计实现</a><span>(1)</span>
</li>
</ul>
</div>
<div id="homepageArticles" class="panel tracking-ad" data-mod="popu_4">
<ul class="panel_head"><span>推荐文章</span></ul>
<ul class="panel_body" id="ad_commend"><iframe id="ad_frm_1" frameborder="0" scrolling="no" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/ad.html" style="border-width: 0px; overflow: hidden; width: 183px; height: 0px;"></iframe></ul>
</div>
<script type="text/javascript">
 new Ad(12, 'ad_commend');
</script><div id="newcomments" class="panel">
<ul class="panel_head"><span>最新评论</span></ul>
<ul class="panel_body itemlist">
    <li>
   
         <a href="http://blog.csdn.net/farmer_cc/article/details/18259117#comments">Android 动画animation 深入分析</a>
    <p style="margin:0px;"><a href="http://blog.csdn.net/kkopopo" class="user_name">junshengluo</a>:
楼主  插入器的函数图是用什么工具画的？
    </p>
    </li>
    <li>
   
         <a href="http://blog.csdn.net/farmer_cc/article/details/31454803#comments">源码分析：onAttach, onMeasure, onLayout, onDraw 的顺序。</a>
    <p style="margin:0px;"><a href="http://blog.csdn.net/gl4532" class="user_name">实体笑</a>:
强势关注！
    </p>
    </li>
    <li>
   
         <a href="http://blog.csdn.net/farmer_cc/article/details/31454803#comments">Android 动画animation 深入分析</a>
    <p style="margin:0px;"><a href="http://blog.csdn.net/benzly2009" class="user_name">benzly2009</a>:
那view到底是怎么动的呢？？？
    </p>
    </li>
    <li>
   
         <a href="http://blog.csdn.net/farmer_cc/article/details/19352563#comments">仿MIUI toast 动画效果实现</a>
    <p style="margin:0px;"><a href="http://blog.csdn.net/u014540181" class="user_name">22dffe2tr3v</a>:
有没有完整的Demo啊，共享一下吧.
    </p>
    </li>
    <li>
   
         <a href="http://blog.csdn.net/farmer_cc/article/details/30800229#comments">源码分析:LayoutParams的wrap_content, match_parent, 和具体值</a>
    <p style="margin:0px;"><a href="http://blog.csdn.net/bhfo1" class="user_name">bhfo1</a>:
博主，可以解释一下，fill_parent么？在listView中，fill_parent与matc...
    </p>
    </li>
    <li>
   
         <a href="http://blog.csdn.net/farmer_cc/article/details/18551657#comments">android 点击效果动画增强</a>
    <p style="margin:0px;"><a href="http://blog.csdn.net/xiedong123xxx" class="user_name">xiedong123xxx</a>:
大哥，你写的不详细啊，没有写怎么调用，你的ACTIVITY里没有实现你的 下面的方法啊
    </p>
    </li>
    <li>
   
         <a href="http://blog.csdn.net/farmer_cc/article/details/18403001#comments">android 点击下弹动画实现</a>
    <p style="margin:0px;"><a href="http://blog.csdn.net/l196024" class="user_name">l196024</a>:
@l196024:啊对了还要特别谢谢PO你分享这个，我要是直接在visible后和gone前写lay...
    </p>
    </li>
    <li>
   
         <a href="http://blog.csdn.net/farmer_cc/article/details/18403001#comments">android 点击下弹动画实现</a>
    <p style="margin:0px;"><a href="http://blog.csdn.net/l196024" class="user_name">l196024</a>:
PO主PO主。。用了你的代码确实实现了visible转gone的动效，但是不知道为什么第二次展开的时...
    </p>
    </li>
    <li>
   
         <a href="http://blog.csdn.net/farmer_cc/article/details/18403001#comments">Android 动画animation 深入分析</a>
    <p style="margin:0px;"><a href="http://blog.csdn.net/haibianqianchang" class="user_name">haibianqianchang</a>:
好资源
    </p>
    </li>
    <li>
   
         <a href="http://blog.csdn.net/farmer_cc/article/details/42305561#comments">迟到的年终总结，2012-2014</a>
    <p style="margin:0px;"><a href="http://blog.csdn.net/apple_zdl" class="user_name">不赢</a>:
哈哈，偶然看到这篇，邻居哦，我在软件园孵化器二号楼，也是做android。送一句祝福吧，诸事顺利，事...
    </p>
    </li>
</ul>
</div>
    </div>
    <div class="clear">
    </div>
 </div>   
            <div class="clear">
            </div>
        </div>
        

<script type="text/javascript" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/cnick.js"></script>
<script type="text/javascript" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/newblog.min.js"></script>


<script type="text/javascript" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/showblogmedal.ashx"></script>
<script type="text/javascript" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/JavaScript1.js"></script><link rel="stylesheet" type="text/css" href="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/pub_footer_2014.css"><div class="pub_fo"><div id="pub_footerall" class="pub_footer_new"><dl><dt></dt> <dd class="foot_sub_menu"><a href="http://www.csdn.net/company/about.html" target="_blank">公司简介</a><span>|</span><a href="http://www.csdn.net/company/recruit.html" target="_blank">招贤纳士</a><span>|</span><a href="http://www.csdn.net/company/marketing.html" target="_blank">广告服务</a><span>|</span><a href="http://www.csdn.net/company/account.html" target="_blank">银行汇款帐号</a><span>|</span><a href="http://www.csdn.net/company/contact.html" target="_blank">联系方式</a><span>|</span><a href="http://www.csdn.net/company/statement.html" target="_blank">版权声明</a><span>|</span><a href="http://www.csdn.net/company/layer.html" target="_blank">法律顾问</a><span>|</span><a href="mailto:webmaster@csdn.net">问题报告</a><span>|</span><a target="_blank" href="http://www.csdn.net/friendlink.html">合作伙伴</a><span>|</span><a href="http://bbs.csdn.net/forums/Service" target="_blank">论坛反馈</a></dd><dd class="foot_contact"><a href="http://wpa.qq.com/msgrd?v=3&uin=2355263776&site=qq&menu=yes" target="_blank" class="qq">网站客服</a><a href="http://wpa.qq.com/msgrd?v=3&uin=2251809102&site=qq&menu=yes" target="_blank" class="qq">杂志客服</a><a href="http://e.weibo.com/csdnsupport/profile" target="_blank" class="weibo">微博客服</a><a href="mailto:webmaster@csdn.net" class="email" title="联系邮箱">webmaster@csdn.net</a><span class="phone" title="服务热线">400-600-2320</span><span class="interval">|</span><span>北京创新乐知信息技术有限公司 版权所有</span><span class="interval">|</span><span>江苏乐知网络技术有限公司 提供商务支持</span></dd><dd class="foot_copyright"><span>京&nbsp;ICP&nbsp;证&nbsp;070598&nbsp;号</span><span class="interval">|</span><span>Copyright © 1999-2014, CSDN.NET, All Rights Reserved&nbsp;</span><a href="http://www.hd315.gov.cn/beian/view.asp?bianhao=010202001032100010" target="_blank"><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/gongshang_logos.gif" alt="GongshangLogo" title=""></a></dd></dl></div></div><div id="note1" class="csdn_note" style="display:none; position:absolute; z-index:9999; width:440px">  <span class="notice_top_arrow"><span class="inner"></span></span>  <div class="box"></div></div><div class="csdn_notice_tip" style="display: none; position: absolute; z-index: 9990; width: 170px;">  <iframe src="about:blank" frameborder="0" scrolling="no" style="z-index:-1;position:absolute;top:0;left:0;width:100%;height:100%;background:transparent"></iframe>  <div class="tip_text">您有<strong>0</strong>条新通知</div>  <a href="javascript:void 0" class="close2"></a></div><script id="noticeScript" type="text/javascript" btnid="header_notice_num" wrapid="note1" count="5" subcount="5" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/notify.js"></script>

    <script type="text/javascript" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/login.js"></script>
<script type="text/javascript">document.write("<img src=http://counter.csdn.net/pv.aspx?id=24 border=0 width=0 height=0>");</script><img src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/pv.aspx" border="0" width="0" height="0">
<script type="text/javascript" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/counter.js"></script><script type="text/javascript" charset="UTF-8" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/msg.popup.js"></script>
<script type="text/javascript" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/ad-blog.js"></script><script type="text/javascript" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/ad-ms1415.js"></script>

<script type="text/javascript" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/count.js"></script>
<script type="text/javascript">
    $(function () {
        function __get_code_toolbar(snippet_id) {
            return $("<a href='https://code.csdn.net/snippets/"
                    + snippet_id
                    + "' target='_blank' title='在CODE上查看代码片' style='text-indent:0;'><img src='https://code.csdn.net/assets/CODE_ico.png' width=12 height=12 alt='在CODE上查看代码片' style='position:relative;top:1px;left:2px;'/></a>"
                    + "<a href='https://code.csdn.net/snippets/"
                    + snippet_id
                    + "/fork' target='_blank' title='派生到我的代码片'  style='text-indent:0;'><img src='https://code.csdn.net/assets/ico_fork.svg' width=12 height=12 alt='派生到我的代码片' style='position:relative;top:2px;left:2px;'/></a>");
        }
        
        $("[code_snippet_id]").each(function () {
            __s_id = $(this).attr("code_snippet_id");
            if (__s_id != null && __s_id != "" && __s_id != 0 && parseInt(__s_id) > 70020) {
                __code_tool = __get_code_toolbar(__s_id);
                $(this).prev().find(".tools").append(__code_tool);
            }
        });
    });
</script>




    </div><input type="hidden" id="aa_g_data_ids">
      <!--new top-->
    
    <script id="csdn-toolbar-id" btnid="header_notice_num" wrapid="note1" count="5" subcount="5" type="text/javascript" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/toolbar.js"></script>
     <!--new top-->
   
    <link href="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/ask_float_block.css" type="text/css" rel="stylesheet">
    <script language="JavaScript" type="text/javascript" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/wmd.js"></script>
    <script language="JavaScript" type="text/javascript" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/showdown.js"></script>
    <script language="JavaScript" type="text/javascript" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/prettify.js"></script>
    <script language="JavaScript" type="text/javascript" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/ask_float_block.js"></script>
   

   
 <div id="tag-suggest-pop">
  <div class="relative">
    <div class="close"></div>
    <div class="content"></div>
  </div>
</div><link rel="stylesheet" type="text/css" media="screen" href="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/ask_float_fonts_css-6b30a53970eb5c3a2a045e3df585b475.css"><div data-mod="popu_64" class="tracking-ad" chg-blk="0"><a id="com-appcode-float-block" href="http://www.csdn.net/app/" target="_blank" title="APP二维码" style="top:251px"><span id="appcode-close"></span></a><a id="com-app-float-block" href="http://www.csdn.net/app/" title="APP下载" style="top:335px"></a><a id="com-quick-reply" title="快速回复" style="top:373px"></a><a id="com-d-top-a" style="top: 411px; display: inline;" title="返回顶部" onclick=""></a> </div><div class="pop_edit ask_second comm_ask_second"><h3>提问</h3><span class="ask_float_span">您的问题将会被发布在“<a class="ask_float_channel" href="http://ask.csdn.net/" target="_blank" style="cursor:pointer">技术问答</a>”频道</span><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" nodetype="close" class="close">×</a><div class="context"><div class="err_div"><span class="err_ico"></span><span class="err_txt">该问题已存在，请勿重复提问</span></div><div class="input_div"><input id="askInputSecond" type="text" style="font-size:14px;" placeholder="问题标题"></div><div class="cm_box"><div class="cm_dialog"></div> <div class="pop_cm cm_add_link"><input type="text" placeholder="链接内容" id="af_cm_link_txt"><input type="text" placeholder="链接地址" id="af_cm_link_url"><input type="text" placeholder="链接提示" id="af_cm_link_tit"><div class="text-right"><span class="btn btn-default btn-sm" id="add_link_btn">插入链接</span> </div> </div><div class="pop_cm cm_add_img"><div class="nav-tabs"><a class="img_tab active" href="http://blog.csdn.net/farmer_cc/article/details/18619429#tab_upload">本地上传</a><a class="img_tab" href="http://blog.csdn.net/farmer_cc/article/details/18619429#tab_weburl">网络图片</a></div><div class="tab_panel active" id="tab_upload"><div class="set_img"><iframe src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/upload.html"></iframe></div></div><div class="tab_panel" id="tab_weburl"><input type="text" placeholder="图片地址" id="af_cm_img_url"><input type="text" placeholder="图片说明" id="af_cm_img_alt"><div class="text-right"><span class="btn btn-default btn-sm" id="add_img_btn">插入图片</span> </div></div> </div></div> <textarea id="editor_all" rows="8" style="display: none;"></textarea><div class="editor-toolbar"><i class="separator">|</i><a class="icon-headline" title="标题一（Ctrl+Alt+1）"></a><a class="icon-heading" title="标题二（Ctrl+Alt+2）"></a><a class="icon-bold" title="粗体（Ctrl+B）"></a><a class="icon-italic" title="斜体（Ctrl+I）"></a><i class="separator">|</i><a class="icon-quote-left" title="引用（Ctrl+’）"></a><a class="icon-code" title="插入代码片（Ctrl+,）"></a><a class="icon-list-ul" title="无序列表（Ctrl+L）"></a><a class="icon-list-ol" title="有序列表（Ctrl+Alt+L）"></a><i class="separator">|</i><a class="icon-link" title="添加链接（Ctrl+K）"></a><a class="icon-picture" title="添加图片（Ctrl+Alt+I）"></a><i class="separator">|</i><a class="icon-reply" title="撤退（Ctrl+Z）"></a><a class="icon-share-alt" title="前进（Ctrl+Shift+Z）"></a><i class="separator">|</i><a class="icon-info" href="http://ask.csdn.net/pages/markdown" target="_blank" title="markdown语法参考"></a><a class="icon-preview" title="预览"></a><i class="separator">|</i></div><div class="CodeMirror cm-s-paper CodeMirror-focused"><div style="overflow: hidden; position: relative; width: 3px; height: 0px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; padding: 0px; width: 1000px; height: 1em; outline: none; font-size: 4px;"></textarea></div><div class="CodeMirror-hscrollbar"><div style="height: 1px;"></div></div><div class="CodeMirror-vscrollbar"><div style="width: 1px;"></div></div><div class="CodeMirror-scrollbar-filler"></div><div class="CodeMirror-gutter-filler"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="min-width: 33px;"><div style="position: relative;"><div class="CodeMirror-lines"><div style="position: relative; outline: none;"><div class="CodeMirror-measure"><pre>&nbsp;<span style="display: inline-block; width: 1px; margin-right: -1px;">&nbsp;</span></pre></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code"></div><div class="CodeMirror-cursor" style="visibility: hidden;">&nbsp;</div><div class="CodeMirror-cursor CodeMirror-secondarycursor" style="visibility: hidden;">&nbsp;</div></div></div></div></div><div style="position: absolute; height: 30px; width: 1px;"></div><div class="CodeMirror-gutters" style="display: none;"></div></div></div><div class="editor-statusbar"><span class="lines">0</span><span class="words">0</span><span class="cursor">0:0</span></div><div class="div_tags clearfix"><div id="divSearchTags" class="tags_con"><input type="text"></div><input type="hidden" name="txtSearchTags"></div><div id="ask2_tagRecomm_div" class="drt_tagRecomm tracking-ad" data-mod="popu_73"><span class="drt_tit">推荐标签：</span></div></div><div class="success"><div class="left_area"><input id="chk_cb" type="checkbox"><span class="wyxs">我要悬赏</span><input id="cb_num" class="cb_num" readonly="true"><span class="phib_rii"><span> 币</span></span></div><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" nodetype="cancel" class="cancel">取消</a><a href="http://blog.csdn.net/farmer_cc/article/details/18619429#" nodetype="ok" class="ok">发布</a></div></div><div id="common_ask_div_sc" class="searchContainer"><div class="sTitle">可能存在类似的问题：</div><div class="sFooter"><a class="sFirstNewAsk">我想提一个新问题</a></div></div><iframe src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/hp-iss-cloud-zhiding-banner-peisong-960-90-30k.html" style="width: 1px; height: 1px; position: absolute; visibility: hidden;"></iframe><style type="text/css" id="xnSmartBarCacheCSSID">

.baiduServiceBottomBar.noDis{display:none !important}.baiduServiceBottomBar.iphoneDevice>ul>li .count{font-size:10px;line-height:12px;height:12px;padding:0px 2px;top:-3px;right:-8px;box-sizing:border-box;font-family:Arial, Helvetica, sans-serif;text-shadow:none;outline:none}.baiduServiceBottomBar.hackIFrame iframe{top:0px;-webkit-transform:translateZ(5px);transform:translateZ(5px)}.baiduServiceBottomBar{overflow:visible;line-height:1;border-top:1px solid #c0c0c0;position:fixed;z-index:10001;width:100%;bottom:0px;background-color:rgba(242,242,242,0.94);background-image:-moz-linear-gradient(rgba(248,248,248,0.94), rgba(242,242,242,0.94));background-image:-o-linear-gradient(rgba(248,248,248,0.94), rgba(242,242,242,0.94));background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, rgba(248,248,248,0.94)), color-stop(1, rgba(242,242,242,0.94)));background-image:-webkit-linear-gradient(rgba(248,248,248,0.94), rgba(242,242,242,0.94));background-image:-ms-linear-gradient(rgba(248,248,248,0.94), rgba(242,242,242,0.94));background-image:linear-gradient(rgba(248,248,248,0.94), rgba(242,242,242,0.94))}.baiduServiceBottomBar div{overflow:visible}.baiduServiceBottomBar div,.baiduServiceBottomBar span,.baiduServiceBottomBar object,.baiduServiceBottomBar iframe,.baiduServiceBottomBar h1,.baiduServiceBottomBar h2,.baiduServiceBottomBar h3,.baiduServiceBottomBar h4,.baiduServiceBottomBar h5,.baiduServiceBottomBar h6,.baiduServiceBottomBar p,.baiduServiceBottomBar a,.baiduServiceBottomBar em,.baiduServiceBottomBar img,.baiduServiceBottomBar b,.baiduServiceBottomBar i,.baiduServiceBottomBar dl,.baiduServiceBottomBar dt,.baiduServiceBottomBar dd,.baiduServiceBottomBar ol,.baiduServiceBottomBar ul,.baiduServiceBottomBar li,.baiduServiceBottomBar fieldset,.baiduServiceBottomBar form,.baiduServiceBottomBar label,.baiduServiceBottomBar table,.baiduServiceBottomBar caption,.baiduServiceBottomBar tbody,.baiduServiceBottomBar tfoot,.baiduServiceBottomBar thead,.baiduServiceBottomBar tr,.baiduServiceBottomBar th,.baiduServiceBottomBar td{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline}.baiduServiceBottomBar p,.baiduServiceBottomBar div,.baiduServiceBottomBar h1,.baiduServiceBottomBar h2,.baiduServiceBottomBar h3,.baiduServiceBottomBar h4,.baiduServiceBottomBar h5,.baiduServiceBottomBar h6{-webkit-text-size-adjust:none}.baiduServiceBottomBar ul,.baiduServiceBottomBar li,.baiduServiceBottomBar a{vertical-align:middle}.baiduServiceBottomBar ol,.baiduServiceBottomBar ul{list-style:none;overflow:visible}.baiduServiceBottomBar .qingIcon{width:22px;height:22px;background-image:url("");margin:10px auto;background-size:100% 100%}.baiduServiceBottomBar .qingBtn{width:48px;height:48px;background-color:#f8f8f8;border:1px solid #ddd}.baiduServiceBottomBar .qingIcon,.baiduServiceBottomBar .qingBtn{display:block}.baiduServiceBottomBar .baiduServiceBarFullScreanMask{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.5);-webkit-transform:scale(1);z-index:100000}.baiduServiceBottomBar .baiduServiceBarPopupContainer{position:fixed;z-index:100001;top:50%;left:50%;width:200px;height:225px;border-radius:5px;margin-left:-100px;margin-top:-125px;background:url("") 50% top #f8f8f8 no-repeat;background-size:105px 120px}.baiduServiceBottomBar .baiduServiceBarPopupContainer .baiduServiceBarPopupClose{background-color:rgba(255,255,255,0);background-image:-moz-linear-gradient(#d0d0d0, rgba(255,255,255,0));background-image:-o-linear-gradient(#d0d0d0, rgba(255,255,255,0));background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, #d0d0d0), color-stop(1, rgba(255,255,255,0)));background-image:-webkit-linear-gradient(#d0d0d0, rgba(255,255,255,0));background-image:-ms-linear-gradient(#d0d0d0, rgba(255,255,255,0));background-image:linear-gradient(#d0d0d0, rgba(255,255,255,0));position:absolute;right:30px;top:0;height:30px;width:1px;display:inline-block}.baiduServiceBottomBar .baiduServiceBarPopupContainer .baiduServiceBarPopupClose:before,.baiduServiceBottomBar .baiduServiceBarPopupContainer .baiduServiceBarPopupClose:after{content:" ";position:absolute;right:-16px;top:7px;width:1px;height:12px;display:inline-block;background:#262626;-webkit-transform:rotateZ(45deg);transform:rotateZ(45deg)}.baiduServiceBottomBar .baiduServiceBarPopupContainer .baiduServiceBarPopupClose:after{-webkit-transform:rotateZ(-45deg);transform:rotateZ(-45deg)}.baiduServiceBottomBar .baiduServiceBarPopupContainer .baiduServiceBarPopupCloseBtn{position:absolute;right:0;top:0;height:30px;width:30px}.baiduServiceBottomBar .baiduServiceBarPopupContainer span{width:100%;text-align:center;display:inline-block;position:absolute;top:125px;font-size:16px;color:#666}.baiduServiceBottomBar .baiduServiceBarPopupContainer .baiduServiceBarPopupInfo{top:150px;font-size:14px}.baiduServiceBottomBar .baiduServiceBarPopupContainer .baiduServiceBarPopupBottomContainer{position:absolute;bottom:0;left:0;width:100%;height:44px;line-height:44px;background:#eee;font-size:16px;color:#262626;border:none;padding:0;border-radius:0 0 5px 5px;border-top:1px solid #d8d8d8}.baiduServiceBottomBar .baiduServiceBarPopupContainer .baiduServiceBarPopupBottomContainer a{float:left;text-align:center;border:none;padding:0px;margin:0;padding-left:15px;display:inline-block;width:50%;height:42px}.baiduServiceBottomBar .baiduServiceBarPopupContainer .baiduServiceBarPopupBottomContainer .baiduServiceBarPopupTel{background:url("") 27% 50% no-repeat;background-size:13px 15px}.baiduServiceBottomBar .baiduServiceBarPopupContainer .baiduServiceBarPopupBottomContainer .baiduServiceBarPopupTel:only-child{background-position:40% 50%;width:100%}.baiduServiceBottomBar .baiduServiceBarPopupContainer .baiduServiceBarPopupBottomContainer .baiduServiceBarPopupConsult{background:url("") 25% 50% no-repeat;background-size:14px 14px}.baiduServiceBottomBar .baiduServiceBarPopupContainer .baiduServiceBarPopupBottomContainer .baiduServiceBarPopupConsult:only-child{background-position:40% 50%;width:100%}.baiduServiceBottomBar .baiduServiceBarPopupContainer .baiduServiceBarPopupBottomContainer .baiduServiceBarPopupTel+.baiduServiceBarPopupConsult{border-left:1px solid #d8d8d8}.baiduServiceBottomBar *{vertical-align:middle;box-sizing:border-box}.baiduServiceBottomBar .baidu-xn-pop-parent{position:relative}.baiduServiceBottomBar .baidu-xn-pop-container{position:absolute;bottom:100%;display:none;z-index:-90;width:113%;background-color:rgba(255,255,255,0.94);background-image:-moz-linear-gradient(rgba(255,255,255,0.94), rgba(255,255,255,0.94));background-image:-o-linear-gradient(rgba(255,255,255,0.94), rgba(255,255,255,0.94));background-image:-webkit-gradient(linear, left top, left bottom, color-stop(0, rgba(255,255,255,0.94)), color-stop(1, rgba(255,255,255,0.94)));background-image:-webkit-linear-gradient(rgba(255,255,255,0.94), rgba(255,255,255,0.94));background-image:-ms-linear-gradient(rgba(255,255,255,0.94), rgba(255,255,255,0.94));background-image:linear-gradient(rgba(255,255,255,0.94), rgba(255,255,255,0.94));left:initial !important;margin-left:-7px;border:1px solid #c0c0c0;border-radius:2px;box-shadow:0px 0px 4px 1px rgba(0,0,0,0.12);margin-bottom:12px;-webkit-transform:scale(1)}.baiduServiceBottomBar .baidu-xn-pop-container ul,.baiduServiceBottomBar .baidu-xn-pop-container li{list-style:none}.baiduServiceBottomBar .baidu-xn-pop-container ul{padding:0px 9px;height:auto}.baiduServiceBottomBar .baidu-xn-pop-container ul>li:not(:last-of-type){border-bottom:1px solid #dddddd}.baiduServiceBottomBar .baidu-xn-pop-container li.vote{height:43px}.baiduServiceBottomBar .baidu-xn-pop-container ul>li{height:36px}.baiduServiceBottomBar .baidu-xn-pop-container ul>li a{padding:1px 0;font-size:14px}.baiduServiceBottomBar .baidu-xn-pop-container.show,.baiduServiceBottomBar .show>.baidu-xn-pop-container{display:block;z-index:-90}.baiduServiceBottomBar .noDis{display:none !important}.baiduServiceBottomBar a{text-decoration:none;color:#001526}.baiduServiceBottomBar>ul{display:-webkit-box;display:-ms-flexbox;display:-moz-box;display:box;width:100%;list-style-type:none;padding:0px;margin:0px;-webkit-box-pack:center;-webkit-box-align:center;box-pack:center;box-align:center;border:0 #fafafb solid;border-width:1px 0 0 1px}.baiduServiceBottomBar>ul>li{display:block;width:3em;-webkit-box-flex:1;flex:1;-ms-flex:1;-moz-box-flex:1;text-align:center;font-size:10px}.baiduServiceBottomBar>ul>li a{font-size:16px;padding:6px 0px 4px;display:inline-block;display:inline-block;width:100%;line-height:34px;height:43px;text-align:center;border:0;-webkit-tap-highlight-color:transparent}.baiduServiceBottomBar>ul>li a p>span.text-char{text-shadow:0 1px #fff}.baiduServiceBottomBar>ul>li a:hover{border-color:transparent}.baiduServiceBottomBar>ul>li .icon{width:18px;height:18px;display:block;margin:0px auto 4px;background-size:100% 100%;vertical-align:middle;position:relative}.baiduServiceBottomBar>ul>li .count-outer{position:relative;width:auto;display:inline-block;line-height:inherit}.baiduServiceBottomBar>ul>li .count{background-color:#f43b3b;color:#fff;border-radius:1px;padding:0px 2px;position:absolute;font-size:10px;line-height:12px;height:12px;top:-3px;right:-10px;font-style:normal;text-shadow:none;outline:none}.baiduServiceBottomBar>ul>li .baidu-xn-pop-container .count{top:3px}.baiduServiceBottomBar>ul li.showMoreBtn{display:none;position:relative}.baiduServiceBottomBar>ul .comment .count{right:-9px}.baiduServiceBottomBar>ul .pop-tip{-webkit-transform:rotateZ(45deg);transform:rotateZ(45deg);width:6px;height:6px;z-index:300;top:-15px;left:-55%;position:absolute;border:1px solid #c0c0c0;background-color:rgba(255,255,255,0.94);display:none}.baiduServiceBottomBar>ul .pop-tip.align-right{margin-left:100%;border-left:0px;border-top:0px}@media only screen and (max-width: 400px){.baiduServiceBottomBar .show-more-buttons>li:nth-of-type(n+4),.baiduServiceBottomBar .show-more-buttons-lg>li:nth-of-type(n+4){display:none}.baiduServiceBottomBar .show-more-buttons>li.showMoreBtn,.baiduServiceBottomBar .show-more-buttons-lg>li.showMoreBtn{display:block}}@media only screen and (min-width: 400px) and (max-width: 480px){.baiduServiceBottomBar .show-more-buttons-lg>li:nth-of-type(n+5){display:none}.baiduServiceBottomBar .show-more-buttons-lg>li.showMoreBtn{display:block}}@media only screen and (max-device-width: 600px){.baiduServiceBottomBar #mobile-phone-detector{display:block}}.baiduServiceBottomBar [data-action=ecomBottomBar-vote]{position:relative}.baiduServiceBottomBar [data-action=ecomBottomBar-vote] .bd_vote{position:absolute;z-index:1;height:100%;width:100%;top:0px}.baiduServiceBottomBar [data-action=ecomBottomBar-vote] .text-char{display:inline-block;-webkit-transform:translateZ(0px);transform:translateZ(0px)}.baiduServiceBottomBar [data-action=ecomBottomBar-vote] .bd_vote iframe{position:relative}.baiduServiceBottomBar>ul>li:last-of-type .baidu-xn-pop-container{right:10px}.baiduServiceBottomBar>ul>li:first-of-type .baidu-xn-pop-container{left:8px !important;margin-left:0px}.baiduServiceBottomBar .baidu-xn-pop-parent:after{position:absolute;top:0px;left:50%;width:12px;height:3px;-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid #c0c0c0;border-left:0px;border-right:0px;margin:6px 0px 6px -6px;content:""}.baiduServiceBottomBar .qingBtn{display:none}.baiduServiceBottomBar.showQingIconStyle.hideContent{border-top:transparent;width:auto}.baiduServiceBottomBar.showQingIconStyle.hideContent .qingBtn{display:block}.baiduServiceBottomBar.showQingIconStyle.hideContent .icon-container{display:none}.baiduServiceBottomBar.showQingIconStyle{display:-webkit-box;display:-ms-flexbox;display:-moz-box;-webkit-box-pack:center;-webkit-box-align:center;box-pack:center;box-align:center}.baiduServiceBottomBar.showQingIconStyle .qingBtn{display:block}.baiduServiceBottomBar.showQingIconStyle>ul>li:first-of-type .baidu-xn-pop-container{left:initial !important;margin-left:-10%}.baiduServiceBottomBar.showQingIconStyle [data-action=ecomBottomBar-showMore]{max-width:50px}.baiduServiceBottomBar.showQingIconStyle [data-action=ecomBottomBar-showMore] .baidu-xn-pop-container{width:180%}.baiduServiceBottomBar.showQingIconStyle [data-action=ecomBottomBar-showMore] .pop-tip.align-right{margin-left:120%}.baiduServiceBottomBar.showQingIconStyle.showContent{width:100%}.baiduServiceBottomBar.showQingIconStyle.showContent .qingBtn{border:1px solid transparent;border-right:1px solid #cdcdcd}.baiduServiceBottomBar.showQingIconStyle.showContent .qingIcon{background-image:url()}.baiduServiceBottomBar.showQingIconStyle.showContent .icon-container{display:-webkit-box;display:-ms-flexbox;display:-moz-box;dislay:box;-webkit-box-flex:1;flex:1;-ms-flex:1;-moz-box-flex:1}.baiduServiceBottomBar.double-scale>ul>li a{line-height:68px;height:86px;font-size:32px;padding:12px 0 4px}.baiduServiceBottomBar.double-scale>ul>li .baidu-xn-pop-container{width:113%}.baiduServiceBottomBar.double-scale>ul>li .baidu-xn-pop-container ul{padding:0px 18px}.baiduServiceBottomBar.double-scale>ul>li .baidu-xn-pop-container ul>li{height:72px;line-height:60px;width:100%}.baiduServiceBottomBar.double-scale>ul>li .baidu-xn-pop-container ul>li a{padding:0px;line-height:72px;height:72px}.baiduServiceBottomBar.double-scale>ul>li .count{font-size:20px;line-height:20px;height:20px;padding:0 6px;top:6px;right:-20px;text-shadow:none;outline:none;border-radius:4px}.baiduServiceBottomBar.double-scale .baidu-xn-pop-parent:after{width:24px;height:6px;margin:12px 0 12px -12px;content:""}@media only screen and (max-width: 800px){.baiduServiceBottomBar.double-scale .show-more-buttons>li:nth-of-type(n+4),.baiduServiceBottomBar.double-scale .show-more-buttons-lg>li:nth-of-type(n+4){display:none}.baiduServiceBottomBar.double-scale .show-more-buttons>li.showMoreBtn,.baiduServiceBottomBar.double-scale .show-more-buttons-lg>li.showMoreBtn{display:block}}@media only screen and (min-width: 800px) and (max-width: 960px){.baiduServiceBottomBar.double-scale .show-more-buttons-lg>li:nth-of-type(n+5){display:none}.baiduServiceBottomBar.double-scale .show-more-buttons-lg>li.showMoreBtn{display:block}}.smb-user-guide-wrapper{position:fixed;z-index:9999;background:rgba(15,15,15,0.8);top:83px;width:238px;height:195px;left:50%;margin-left:-119px;border-radius:10px;font-size:14px;font-family:sans-serif}.smb-user-guide-wrapper .bg-pic{margin-top:24px;height:131px;background:url(//m.baidu.com/static/search/siteapp/lego/use_guide.png) center no-repeat;background-size:208px 131px}.smb-user-guide-wrapper .queryX{position:absolute;left:44px;top:90px}.smb-user-guide-wrapper .closeX{display:block;margin:8px auto;color:#fff;width:110px;height:25px;line-height:25px;text-align:center}.baiduServiceBarPopupShow .baiduServiceBarFullScreanMask,.baiduServiceBarPopupShow .baiduServiceBarPopupContainer{display:block}.baiduServiceBarFullScreanMask,.baiduServiceBarPopupContainer,.baiduServiceBarPopupHideLeft .baiduServiceBarFullScreanMask,.baiduServiceBarPopupHideRight .baiduServiceBarFullScreanMask{display:none}.baiduServiceBarPopupHideLeft .baiduServiceBarPopupContainer,.baiduServiceBarPopupHideRight .baiduServiceBarPopupContainer{animation-duration:1s;-webkit-animation-duration:1s;-webkit-animation-name:fadeOutDownRight;animation-name:fadeOutDownRight;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;transition:All 1s ease-in-out;-webkit-transition:All 1s ease-in-out}.baiduServiceBarPopupHideLeft .baiduServiceBarPopupContainer{-webkit-animation-name:fadeOutDownLeft;animation-name:fadeOutDownLeft}@-webkit-keyframes fadeOutDownLeft{0%{opacity:1}30%{opacity:.8;-webkit-transform:scale3d(0.1, 0.1, 0.1) translate3d(0, 0px, 0);transform:scale3d(0.1, 0.1, 0.1) translate3d(0, 0px, 0)}100%{opacity:0;top:100%;left:5%;-webkit-transform:rotate(45deg) scale3d(0.1, 0.1, 0.1)}}@keyframes fadeOutDownLeft{0%{opacity:1}30%{opacity:.8;-webkit-transform:scale3d(0.1, 0.1, 0.1) translate3d(0, 0px, 0);transform:scale3d(0.1, 0.1, 0.1) translate3d(0, 0px, 0)}100%{opacity:0;top:100%;left:5%;-webkit-transform:rotate(45deg) scale3d(0.1, 0.1, 0.1)}}@-webkit-keyframes fadeOutDownRight{0%{opacity:1}30%{opacity:.8;-webkit-transform:scale3d(0.1, 0.1, 0.1) translate3d(0, 0px, 0);transform:scale3d(0.1, 0.1, 0.1) translate3d(0, 0px, 0)}100%{opacity:0;top:100%;left:95%;-webkit-transform:rotate(-45deg) scale3d(0.1, 0.1, 0.1)}}@keyframes fadeOutDownRight{0%{opacity:1}30%{opacity:.8;-webkit-transform:scale3d(0.1, 0.1, 0.1) translate3d(0, 0px, 0);transform:scale3d(0.1, 0.1, 0.1) translate3d(0, 0px, 0)}100%{opacity:0;top:100%;left:95%;-webkit-transform:rotate(-45deg) scale3d(0.1, 0.1, 0.1)}}.baiduServiceBottomBar [data-action=ecomBottomBar-follow]{position:relative}.baiduServiceBottomBar [data-action=ecomBottomBar-follow] .bd_follow{background:transparent;position:absolute;width:100%;height:100%;top:0;left:0;z-index:2}.baiduServiceBottomBar [data-action=ecomBottomBar-follow] .bd_follow iframe{width:100%;height:100%;background:transparent}.baiduServiceBottomBar .ecomBottomBar-typek14 .cross-wrap{display:inline-block;width:15px;margin-right:4px}.baiduServiceBottomBar .ecomBottomBar-typek14 .cross-wrap .cross{display:inline-block;top:1px;background:#f43b3b;height:14px;position:relative;width:1px}.baiduServiceBottomBar .ecomBottomBar-typek14 .cross-wrap .cross:after{background:#f43b3b;content:"";height:1px;left:-7px;position:absolute;top:6px;width:15px}.baiduServiceBottomBar .ecomBottomBar-typek14 .text-char{color:#f43b3b}.baiduServiceBottomBar .ecomBottomBar-typek14 .text-char.followed{color:#999}.baiduServiceBottomBar .ecomBottomBar-typek4 .text-char.followed{color:#999}.baiduServiceBottomBar-toast-container{position:fixed;z-index:99999999;width:100%;bottom:50px;text-align:center}.baiduServiceBottomBar-toast-container .toast-text{min-width:40%;max-width:80%;overflow:hidden;word-break:break-all;word-wrap:nowrap;text-overflow:ellipsis;background-color:rgba(0,0,0,0.75);opacity:0;-webkit-transition:opacity 1s linear 0s;border-radius:5px;color:#fff;padding:10px;margin:0px auto;font-size:16px}.baiduServiceBottomBar-toast-container.show .toast-text{opacity:1}.baiduServiceBottomBar-toast-container.noDis{display:none !important}body,html{padding:0px;margin:0px}

/**
 * 用于将 css 以内联 js 的形式插入到页面中去
 */
</style><script type="text/javascript" charset="utf-8" src="http://127.0.0.1:7777/getcuid?callback=xnJSONP026934" defer=""></script><div class="baiduServiceBottomBar noDis"><a class="qingBtn" data-action="ecomBottomBar-iconBtn" onclick="javascript:void(0);"><i class="qingIcon"></i></a><ul class="showCount-4 icon-container"><li><a data-action="ecomBottomBar-follow" onclick="javascript:void(0);" class="ecomBottomBar-typek14"><p class="count-outer"><span class="text-char  "><span class="cross-wrap"> <span class="cross"></span></span>关注</span><span class="count noDis"></span></p><div class="bd_follow"><iframe src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/follow.html" id="follow143943367573440"></iframe></div></a></li><li><a data-action="ecomBottomBar-comment" onclick="javascript:void(0);" class="hackTJMark ecomBottomBar-typeACTION"><p class="count-outer"><span class="text-char  ">评价</span><span class="count noDis"></span></p></a></li><li><a data-action="qingBottomBarShare" onclick="javascript:void(0);" class="ecomBottomBar-typek3"><p class="count-outer"><span class="text-char  ">分享</span><span class="count noDis"></span></p></a></li><li><a data-action="ecomBottomBar-vote" onclick="javascript:void(0);" class="ecomBottomBar-typek6"><p class="count-outer"><span class="text-char  ">赞</span><span class="count noDis"></span></p><div class="bd_vote" data-inited="1"><iframe id="vote14394336759723" style="border: none; width: 100%; height: 100%; display: block;" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/like.html"></iframe></div></a></li><li class="showMoreBtn baidu-xn-pop-parent" data-action="ecomBottomBar-showMore"><a onclick="javascript:void(0);">更多</a><div class="noDis"><div class="baidu-xn-pop-container"><div class="pop-content"><ul></ul></div></div><div class="pop-tip align-right" style="display: none;"></div></div></li></ul><!-- hack form mobile phone detect --><span id="mobile-phone-detector"></span></div><script type="text/javascript" charset="utf-8" src="./深入分析UI 上层事件处理核心机制 Choreographer - farmer_cc的专栏 - 博客频道 - CSDN.NET_files/vote.js" async=""></script></body></html>